@biorate/schema-registry 0.23.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 ADDED
@@ -0,0 +1,21 @@
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.23.0](https://github.com/biorate/core/compare/v0.22.0...v0.23.0) (2022-04-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **schema-registry:** decode / encode logic ([8797cb8](https://github.com/biorate/core/commit/8797cb8259dbd8a0c0ffc7c13655f1df0b3b212b))
12
+ * **schema-registry:** decode / encode logic ([142c998](https://github.com/biorate/core/commit/142c9981bf9824b79d5d443566e7f0a24491bcaa))
13
+ * **schema-registry:** decode / encode logic ([4be6de4](https://github.com/biorate/core/commit/4be6de4ace210010b18dbf016943138a957d0207))
14
+ * **schema-registry:** develop ([69018fb](https://github.com/biorate/core/commit/69018fbe80402c847fef968f6b140001a1ba618a))
15
+ * **schema-registry:** develop ([aec2fda](https://github.com/biorate/core/commit/aec2fda269b9847a1ceca8d49ee51f8eec1d71aa))
16
+
17
+
18
+ ### Features
19
+
20
+ * **axios:** contract fetch changed ([6c0f589](https://github.com/biorate/core/commit/6c0f589211a7c34b56f9f845762bdd64ed6ac650))
21
+ * **schema-registry:** release, module added ([d92b96c](https://github.com/biorate/core/commit/d92b96c337f24f0b58fa2f2aade0ebd779c4c75d))
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,78 @@
1
+ # Schema registry
2
+
3
+ Schema registry connector
4
+
5
+ ### Examples:
6
+
7
+ ```ts
8
+ import { inject, container, Types, Core } from '@biorate/inversion';
9
+ import { IConfig, Config } from '@biorate/config';
10
+ import { IConnector } from '@biorate/connector';
11
+ import {
12
+ SchemaRegistryConnector,
13
+ ISchemaRegistryConnection,
14
+ ISchemaRegistryConfig,
15
+ } from '@biorate/schema-registry';
16
+
17
+ export class Root extends Core() {
18
+ @inject(SchemaRegistryConnector) public connector: IConnector<
19
+ ISchemaRegistryConfig,
20
+ ISchemaRegistryConnection
21
+ >;
22
+ }
23
+
24
+ container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
25
+ container
26
+ .bind<SchemaRegistryConnector>(SchemaRegistryConnector)
27
+ .toSelf()
28
+ .inSingletonScope();
29
+ container.bind<Root>(Root).toSelf().inSingletonScope();
30
+
31
+ container.get<IConfig>(Types.Config).merge({
32
+ SchemaRegistry: [{ name: 'connection', baseURL: 'http://localhost:8085' }],
33
+ });
34
+
35
+ (async () => {
36
+ const root = container.get<Root>(Root);
37
+ await root.$run();
38
+
39
+ const { PostSubjectsVersions } = root.connector.connection('connection');
40
+ const { data } = await PostSubjectsVersions.fetch({
41
+ subject: 'test',
42
+ schema: {
43
+ type: 'record',
44
+ name: 'Test',
45
+ namespace: 'test',
46
+ fields: [
47
+ {
48
+ name: 'firstName',
49
+ type: 'string',
50
+ },
51
+ {
52
+ name: 'lastName',
53
+ type: 'string',
54
+ },
55
+ {
56
+ name: 'age',
57
+ type: 'int',
58
+ },
59
+ ],
60
+ },
61
+ });
62
+ console.log(data); // { id: 1 }
63
+ })();
64
+ ```
65
+
66
+ ### Learn
67
+
68
+ - Documentation can be found here - [docs](https://biorate.github.io/core/modules/schema_registry.html).
69
+
70
+ ### Release History
71
+
72
+ See the [CHANGELOG](https://github.com/biorate/core/blob/master/packages/%40biorate/schema-registry/CHANGELOG.md)
73
+
74
+ ### License
75
+
76
+ [MIT](https://github.com/biorate/core/blob/master/packages/%40biorate/schema-registry/LICENSE)
77
+
78
+ 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,178 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create = void 0;
4
+ const axios_1 = require("@biorate/axios");
5
+ const avsc_1 = require("avsc");
6
+ const create = (config) => {
7
+ const cache = new Map();
8
+ class SchemaRegistryApi extends axios_1.Axios {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.baseURL = config.baseURL;
12
+ }
13
+ }
14
+ class Ping extends SchemaRegistryApi {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.url = '/';
18
+ this.method = 'get';
19
+ }
20
+ static fetch(...args) {
21
+ return this._fetch({}, ...args);
22
+ }
23
+ }
24
+ class GetSchemasById extends SchemaRegistryApi {
25
+ constructor() {
26
+ super(...arguments);
27
+ this.url = '/schemas/ids/:id';
28
+ this.method = 'get';
29
+ }
30
+ static fetch(id, ...args) {
31
+ return this._fetch({ path: { id } }, ...args);
32
+ }
33
+ }
34
+ class GetSchemasTypes extends SchemaRegistryApi {
35
+ constructor() {
36
+ super(...arguments);
37
+ this.url = '/schemas/types';
38
+ this.method = 'get';
39
+ }
40
+ static fetch(...args) {
41
+ return this._fetch({}, ...args);
42
+ }
43
+ }
44
+ class GetSchemasVersionsById extends SchemaRegistryApi {
45
+ constructor() {
46
+ super(...arguments);
47
+ this.url = '/schemas/ids/:id/versions';
48
+ this.method = 'get';
49
+ }
50
+ static fetch(id, ...args) {
51
+ return this._fetch({ path: { id } }, ...args);
52
+ }
53
+ }
54
+ class GetSubjects extends SchemaRegistryApi {
55
+ constructor() {
56
+ super(...arguments);
57
+ this.url = '/subjects';
58
+ this.method = 'get';
59
+ }
60
+ static fetch(...args) {
61
+ return this._fetch({}, ...args);
62
+ }
63
+ }
64
+ class GetSubjectsVersions extends SchemaRegistryApi {
65
+ constructor() {
66
+ super(...arguments);
67
+ this.url = '/subjects/:subject/versions';
68
+ this.method = 'get';
69
+ }
70
+ static fetch(subject, ...args) {
71
+ return this._fetch({ path: { subject } }, ...args);
72
+ }
73
+ }
74
+ class DeleteSubjects extends SchemaRegistryApi {
75
+ constructor() {
76
+ super(...arguments);
77
+ this.url = '/subjects/:subject';
78
+ this.method = 'delete';
79
+ }
80
+ static fetch(data, ...args) {
81
+ return this._fetch({ path: { subject: data.subject }, params: { permanent: !!data.permanent } }, ...args);
82
+ }
83
+ }
84
+ class GetSubjectsByVersion extends SchemaRegistryApi {
85
+ constructor() {
86
+ super(...arguments);
87
+ this.url = '/subjects/:subject/versions/:version';
88
+ this.method = 'get';
89
+ }
90
+ static fetch(data, ...args) {
91
+ return this._fetch({ path: data }, ...args);
92
+ }
93
+ }
94
+ class GetSchemaBySubjectsAndVersion extends SchemaRegistryApi {
95
+ constructor() {
96
+ super(...arguments);
97
+ this.url = '/subjects/:subject/versions/:version/schema';
98
+ this.method = 'get';
99
+ }
100
+ static fetch(data, ...args) {
101
+ return this._fetch({ path: data }, ...args);
102
+ }
103
+ }
104
+ class PostSubjectsVersions extends SchemaRegistryApi {
105
+ constructor() {
106
+ super(...arguments);
107
+ this.url = '/subjects/:subject/versions';
108
+ this.method = 'post';
109
+ }
110
+ static fetch(data, ...args) {
111
+ return this._fetch({
112
+ path: { subject: data.subject },
113
+ params: { normalize: !!data.normalize },
114
+ data: {
115
+ schema: toStringData(data.schema),
116
+ schemaType: data.schemaType,
117
+ reference: data.reference,
118
+ },
119
+ }, ...args);
120
+ }
121
+ }
122
+ class PostSubjects extends SchemaRegistryApi {
123
+ constructor() {
124
+ super(...arguments);
125
+ this.url = '/subjects/:subject';
126
+ this.method = 'post';
127
+ }
128
+ static fetch(data, ...args) {
129
+ return this._fetch({
130
+ path: { subject: data.subject },
131
+ params: { normalize: !!data.normalize },
132
+ data: {
133
+ schema: toStringData(data.schema),
134
+ schemaType: data.schemaType,
135
+ reference: data.reference,
136
+ },
137
+ }, ...args);
138
+ }
139
+ }
140
+ async function encode(subject, data, version = 'latest') {
141
+ const response = await GetSubjectsByVersion.fetch({ subject, version });
142
+ const header = Buffer.alloc(5);
143
+ const schema = avsc_1.Type.forSchema(JSON.parse(response.data.schema));
144
+ header.writeInt32BE(response.data.id, 1);
145
+ return Buffer.concat([header, schema.toBuffer(data)]);
146
+ }
147
+ async function decode(buffer) {
148
+ const id = buffer.readInt32BE(1);
149
+ let data = cache.get(id);
150
+ if (!data) {
151
+ const response = await GetSchemasById.fetch(id);
152
+ data = avsc_1.Type.forSchema(JSON.parse(response.data.schema));
153
+ cache.set(id, data);
154
+ }
155
+ const schema = avsc_1.Type.forSchema(data);
156
+ return schema.fromBuffer(buffer.slice(5));
157
+ }
158
+ function toStringData(data) {
159
+ return typeof data === 'string' ? data : JSON.stringify(data);
160
+ }
161
+ return {
162
+ ping: Ping.fetch.bind(Ping),
163
+ getSchemasById: (GetSchemasById.fetch.bind(GetSchemasById)),
164
+ getSchemasTypes: (GetSchemasTypes.fetch.bind(GetSchemasTypes)),
165
+ getSchemasVersionsById: (GetSchemasVersionsById.fetch.bind(GetSchemasVersionsById)),
166
+ getSubjects: GetSubjects.fetch.bind(GetSubjects),
167
+ getSubjectsVersions: (GetSubjectsVersions.fetch.bind(GetSubjectsVersions)),
168
+ deleteSubjects: (DeleteSubjects.fetch.bind(DeleteSubjects)),
169
+ getSubjectsByVersion: (GetSubjectsByVersion.fetch.bind(GetSubjectsByVersion)),
170
+ getSchemaBySubjectsAndVersion: (GetSchemaBySubjectsAndVersion.fetch.bind(GetSchemaBySubjectsAndVersion)),
171
+ postSubjects: PostSubjects.fetch.bind(PostSubjects),
172
+ postSubjectsVersions: (PostSubjectsVersions.fetch.bind(PostSubjectsVersions)),
173
+ encode,
174
+ decode,
175
+ };
176
+ };
177
+ exports.create = create;
178
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,+BAA4B;AAGrB,MAAM,MAAM,GAAG,CAAC,MAA6B,EAAE,EAAE;IACtD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgB,CAAC;IAEtC,MAAM,iBAAkB,SAAQ,aAAK;QAArC;;YACS,YAAO,GAAG,MAAM,CAAC,OAAO,CA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Y,CAAC,IAAkC;QACtD,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IAED,OAAO;QACL,IAAI,EAAqB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9C,cAAc,EAA+B,CAC3C,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAC1C;QACD,eAAe,EAAgC,CAC7C,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAC5C;QACD,sBAAsB,EAAuC,CAC3D,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAC1D;QACD,WAAW,EAA4B,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;QAC1E,mBAAmB,EAAoC,CACrD,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CACpD;QACD,cAAc,EAA+B,CAC3C,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAC1C;QACD,oBAAoB,EAAqC,CACvD,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CACtD;QACD,6BAA6B,EAA8C,CACzE,6BAA6B,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CACxE;QACD,YAAY,EAA6B,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC;QAC9E,oBAAoB,EAAqC,CACvD,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CACtD;QACD,MAAM;QACN,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AA9NW,QAAA,MAAM,UA8NjB"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchemaRegistryCantConnectError = void 0;
4
+ const errors_1 = require("@biorate/errors");
5
+ class SchemaRegistryCantConnectError extends errors_1.BaseError {
6
+ constructor(e) {
7
+ super(`Can't connect to schema registry: [%s]`, [e.message]);
8
+ }
9
+ }
10
+ exports.SchemaRegistryCantConnectError = SchemaRegistryCantConnectError;
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,8BAA+B,SAAQ,kBAAS;IAC3D,YAAmB,CAAQ;QACzB,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF;AAJD,wEAIC"}
@@ -0,0 +1,47 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.SchemaRegistryConnector = void 0;
20
+ const inversion_1 = require("@biorate/inversion");
21
+ const connector_1 = require("@biorate/connector");
22
+ const errors_1 = require("./errors");
23
+ const api_1 = require("./api");
24
+ __exportStar(require("./api"), exports);
25
+ __exportStar(require("./errors"), exports);
26
+ __exportStar(require("./interfaces"), exports);
27
+ let SchemaRegistryConnector = class SchemaRegistryConnector extends connector_1.Connector {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.namespace = 'SchemaRegistry';
31
+ }
32
+ async connect(config) {
33
+ const connection = (0, api_1.create)(config);
34
+ try {
35
+ await connection.ping();
36
+ }
37
+ catch (e) {
38
+ throw new errors_1.SchemaRegistryCantConnectError(e);
39
+ }
40
+ return connection;
41
+ }
42
+ };
43
+ SchemaRegistryConnector = __decorate([
44
+ (0, inversion_1.injectable)()
45
+ ], SchemaRegistryConnector);
46
+ exports.SchemaRegistryConnector = SchemaRegistryConnector;
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,kDAAgD;AAEhD,kDAA+C;AAC/C,qCAA0D;AAC1D,+BAA+B;AAC/B,wCAAsB;AACtB,2CAAyB;AACzB,+CAA6B;AAqE7B,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,qBAG5C;IAHD;;QAIqB,cAAS,GAAG,gBAAgB,CAAC;IAUlD,CAAC;IATW,KAAK,CAAC,OAAO,CAAC,MAAM;QAC5B,MAAM,UAAU,GAAG,IAAA,YAAM,EAAC,MAAM,CAAC,CAAC;QAClC,IAAI;YACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,uCAA8B,CAAC,CAAC,CAAC,CAAC;SAC7C;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAdY,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAcnC;AAdY,0DAAuB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interfaces.js.map
@@ -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","../../connector/src/interfaces.ts","../../connector/src/errors.ts","../../connector/src/index.ts","../../connector/index.ts","../../axios/node_modules/axios/index.d.ts","../../axios/node_modules/axios-retry/index.d.ts","../../axios/src/index.ts","../../axios/index.ts","../node_modules/avsc/types/index.d.ts","../src/api.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","ef44188502c439a13052640bc755a2f85f5f8a96d454a0aac17aba156e795c18","364d890be1c074ff8aa1d3ef5a8e711f4f2b17ea69121719d937a0f15d376bf9","dcb72c624557353e74d67d41c720ff51434400ab3d833f7247fc8c090f3f961c","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","2808645b990069e5f8b5ff14c9f1e6077eb642583c3f7854012d60757f23c70e","6573d7e13fca725d1da5fb30bb6e767ca5b3032bde1df13441c4742a1d03792a","259cf2114c9d32f85b023f15adc3f30ebc7d97d7019bd4391cc37dec6ce3f61a","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","769fcd8d11d22e632ab6f098e967ef3627b592b0ab9c990f37075197ddb27ef6",{"version":"d54d9d377eae2cb26baed58b5cccde35c9c09aeee60c364ff977f45f468f1949","signature":"19f6433967e1f70afff04e2dfb9f256ac15a7f049f834956c531a9c144cef839"},"75ae6a3b2814fad3c554eb26eeb758726b63262953d28f5d874a55c127aba9ef",{"version":"70c80002c78e4d48542a7f3d82e25fe706e0ffb2227f7077be775db7569897b5","signature":"cd0550c8e66ca386a203da7d93175c30224f4fd8fea4933bbbb73698d38954f8"},{"version":"f43c57d6560ecedef328e154651da9331ee82cedd2c1c931f59817fdfc71174d","signature":"b5332c3a4fdc02652d7275b288bb3b51ced3381c70de09c510e05fa6b6f6e0e7"},"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":[[173],[121,173],[120,173],[127,128,173],[125,126,127,173],[145,146,173,180,181],[146,173,180],[173,184],[173,185],[73,75,76,77,78,79,80,81,82,83,84,85,173],[73,74,76,77,78,79,80,81,82,83,84,85,173],[74,75,76,77,78,79,80,81,82,83,84,85,173],[73,74,75,77,78,79,80,81,82,83,84,85,173],[73,74,75,76,78,79,80,81,82,83,84,85,173],[73,74,75,76,77,79,80,81,82,83,84,85,173],[73,74,75,76,77,78,80,81,82,83,84,85,173],[73,74,75,76,77,78,79,81,82,83,84,85,173],[73,74,75,76,77,78,79,80,82,83,84,85,173],[73,74,75,76,77,78,79,80,81,83,84,85,173],[73,74,75,76,77,78,79,80,81,82,84,85,173],[73,74,75,76,77,78,79,80,81,82,83,85,173],[73,74,75,76,77,78,79,80,81,82,83,84,173],[130,173],[133,173],[134,139,173],[135,145,146,153,162,172,173],[135,136,145,153,173],[137,173],[138,139,146,154,173],[139,162,169,173],[140,142,145,153,173],[141,173],[142,143,173],[144,145,173],[145,173],[145,146,147,162,172,173],[145,146,147,162,173],[148,153,162,172,173],[145,146,148,149,153,162,169,172,173],[148,150,162,169,172,173],[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,170,171,172,173,174,175,176,177,178,179],[145,151,173],[152,172,173],[142,145,153,162,173],[154,173],[155,173],[133,156,173],[157,171,173,177],[158,173],[159,173],[145,160,173],[160,161,173,175],[145,162,163,164,173],[162,164,173],[162,163,173],[165,173],[166,173],[145,167,168,173],[167,168,173],[139,153,169,173],[170,173],[153,171,173],[134,148,159,172,173],[139,173],[162,173,174],[173,175],[173,176],[134,139,145,147,156,162,172,173,175,177],[162,173,178],[173,193],[112,173],[110,111,173],[85,110,111,173],[104,173],[85,86,173],[85,101,102,103,173],[85,173],[108,173],[86,173],[101,105,106,107,173],[100,173],[65,173],[46,173],[45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,173],[44,70,71,99,173],[65,66,67,70,173],[69,173],[98,173],[44,85,97,173],[118,173],[145,162,173],[113,114,116,173],[101,109,115,116,117,173],[109,115,173],[68,173],[91,96,173],[87,173],[91,173],[87,88,89,90,92,93,94,95,173],[110,111,116],[86],[109,110,111,115,116,117]],"referencedMap":[[121,1],[120,1],[122,2],[123,3],[124,1],[129,4],[125,1],[128,5],[127,1],[182,6],[183,7],[184,1],[185,8],[186,9],[126,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],[181,1],[187,1],[188,1],[130,23],[131,23],[133,24],[134,25],[135,26],[136,27],[137,28],[138,29],[139,30],[140,31],[141,32],[142,33],[143,33],[144,34],[145,35],[146,36],[147,37],[132,1],[179,1],[148,38],[149,39],[150,40],[180,41],[151,42],[152,43],[153,44],[154,45],[155,46],[156,47],[157,48],[158,49],[159,50],[160,51],[161,52],[162,53],[164,54],[163,55],[165,56],[166,57],[167,58],[168,59],[169,60],[170,61],[171,62],[172,63],[173,64],[174,65],[175,66],[176,67],[177,68],[178,69],[189,1],[190,1],[191,1],[192,1],[193,1],[194,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],[113,71],[111,72],[110,1],[112,73],[105,74],[102,75],[104,76],[103,77],[109,78],[107,79],[108,80],[106,1],[86,1],[101,81],[67,1],[66,82],[61,83],[53,83],[50,1],[56,83],[52,1],[54,1],[58,1],[51,1],[57,1],[55,1],[48,83],[45,1],[47,83],[49,83],[46,1],[65,84],[59,83],[62,83],[64,82],[60,1],[63,83],[44,1],[100,85],[71,86],[70,87],[99,88],[98,89],[119,90],[114,91],[115,92],[117,79],[118,93],[116,94],[69,95],[68,1],[97,96],[91,1],[95,97],[92,98],[88,1],[87,79],[94,1],[96,99],[90,1],[89,46],[93,1]],"exportedModulesMap":[[121,1],[120,1],[122,2],[123,3],[124,1],[129,4],[125,1],[128,5],[127,1],[182,6],[183,7],[184,1],[185,8],[186,9],[126,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],[181,1],[187,1],[188,1],[130,23],[131,23],[133,24],[134,25],[135,26],[136,27],[137,28],[138,29],[139,30],[140,31],[141,32],[142,33],[143,33],[144,34],[145,35],[146,36],[147,37],[132,1],[179,1],[148,38],[149,39],[150,40],[180,41],[151,42],[152,43],[153,44],[154,45],[155,46],[156,47],[157,48],[158,49],[159,50],[160,51],[161,52],[162,53],[164,54],[163,55],[165,56],[166,57],[167,58],[168,59],[169,60],[170,61],[171,62],[172,63],[173,64],[174,65],[175,66],[176,67],[177,68],[178,69],[189,1],[190,1],[191,1],[192,1],[193,1],[194,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],[113,71],[111,72],[110,1],[112,73],[105,74],[102,75],[104,76],[103,77],[109,78],[107,79],[108,80],[106,1],[86,1],[101,81],[67,1],[66,82],[61,83],[53,83],[50,1],[56,83],[52,1],[54,1],[58,1],[51,1],[57,1],[55,1],[48,83],[45,1],[47,83],[49,83],[46,1],[65,84],[59,83],[62,83],[64,82],[60,1],[63,83],[44,1],[100,85],[71,86],[70,87],[99,88],[98,89],[119,90],[114,91],[115,100],[117,101],[118,102],[116,94],[69,95],[68,1],[97,96],[91,1],[95,97],[92,98],[88,1],[87,79],[94,1],[96,99],[90,1],[89,46],[93,1]],"semanticDiagnosticsPerFile":[121,120,122,123,124,129,125,128,127,182,183,184,185,186,126,74,75,73,76,77,78,79,80,81,82,83,84,85,181,187,188,130,131,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,132,179,148,149,150,180,151,152,153,154,155,156,157,158,159,160,161,162,164,163,165,166,167,168,169,170,171,172,173,174,175,176,177,178,189,190,191,192,193,194,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,113,111,110,112,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,119,114,115,117,118,116,69,68,97,91,95,92,88,87,94,96,90,89,93]},"version":"4.5.5"}
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './src';
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@biorate/schema-registry",
3
+ "version": "0.23.0",
4
+ "description": "Schema registry connector",
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/schema-registry"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "homepage": "https://biorate.github.io/core",
20
+ "keywords": [
21
+ "schema registry",
22
+ "confluent",
23
+ "kafka"
24
+ ],
25
+ "author": "llevkin",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "@biorate/axios": "0.21.0",
29
+ "@biorate/config": "0.21.0",
30
+ "@biorate/connector": "0.21.0",
31
+ "@biorate/errors": "0.21.0",
32
+ "@biorate/inversion": "0.21.0",
33
+ "avsc": "^5.7.4"
34
+ },
35
+ "gitHead": "bd7945dd18eb28475ca5df50d4117c23aed1291f"
36
+ }
package/src/api.ts ADDED
@@ -0,0 +1,227 @@
1
+ import { Axios } from '@biorate/axios';
2
+ import { Type } from 'avsc';
3
+ import { ISchemaRegistryConfig } from './interfaces';
4
+
5
+ export const create = (config: ISchemaRegistryConfig) => {
6
+ const cache = new Map<number, Type>();
7
+
8
+ class SchemaRegistryApi extends Axios {
9
+ public baseURL = config.baseURL;
10
+ }
11
+
12
+ class Ping extends SchemaRegistryApi {
13
+ public url = '/';
14
+ public method = 'get';
15
+
16
+ public static fetch(...args) {
17
+ return this._fetch<{}>({}, ...args);
18
+ }
19
+ }
20
+
21
+ class GetSchemasById extends SchemaRegistryApi {
22
+ public url = '/schemas/ids/:id';
23
+ public method = 'get';
24
+
25
+ public static fetch(id: number, ...args) {
26
+ return this._fetch<{ schema: string }>({ path: { id } }, ...args);
27
+ }
28
+ }
29
+
30
+ class GetSchemasTypes extends SchemaRegistryApi {
31
+ public url = '/schemas/types';
32
+ public method = 'get';
33
+
34
+ public static fetch(...args) {
35
+ return this._fetch<string[]>({}, ...args);
36
+ }
37
+ }
38
+
39
+ class GetSchemasVersionsById extends SchemaRegistryApi {
40
+ public url = '/schemas/ids/:id/versions';
41
+ public method = 'get';
42
+
43
+ public static fetch(id: number, ...args) {
44
+ return this._fetch<{ subject: string; version: number }[]>(
45
+ { path: { id } },
46
+ ...args,
47
+ );
48
+ }
49
+ }
50
+
51
+ class GetSubjects extends SchemaRegistryApi {
52
+ public url = '/subjects';
53
+ public method = 'get';
54
+
55
+ public static fetch(...args) {
56
+ return this._fetch<string[]>({}, ...args);
57
+ }
58
+ }
59
+
60
+ class GetSubjectsVersions extends SchemaRegistryApi {
61
+ public url = '/subjects/:subject/versions';
62
+ public method = 'get';
63
+
64
+ public static fetch(subject: string, ...args) {
65
+ return this._fetch<number[]>({ path: { subject } }, ...args);
66
+ }
67
+ }
68
+
69
+ class DeleteSubjects extends SchemaRegistryApi {
70
+ public url = '/subjects/:subject';
71
+ public method = 'delete';
72
+
73
+ public static fetch(data: { subject: string; permanent?: boolean }, ...args) {
74
+ return this._fetch<number[]>(
75
+ { path: { subject: data.subject }, params: { permanent: !!data.permanent } },
76
+ ...args,
77
+ );
78
+ }
79
+ }
80
+
81
+ class GetSubjectsByVersion extends SchemaRegistryApi {
82
+ public url = '/subjects/:subject/versions/:version';
83
+ public method = 'get';
84
+
85
+ public static fetch(data: { subject: string; version: number | string }, ...args) {
86
+ return this._fetch<{
87
+ subject: string;
88
+ id: number;
89
+ version: number;
90
+ schemaType: string;
91
+ schema: string;
92
+ }>({ path: data }, ...args);
93
+ }
94
+ }
95
+
96
+ class GetSchemaBySubjectsAndVersion extends SchemaRegistryApi {
97
+ public url = '/subjects/:subject/versions/:version/schema';
98
+ public method = 'get';
99
+
100
+ public static fetch(data: { subject: string; version: number | string }, ...args) {
101
+ return this._fetch<unknown>({ path: data }, ...args);
102
+ }
103
+ }
104
+
105
+ class PostSubjectsVersions extends SchemaRegistryApi {
106
+ public url = '/subjects/:subject/versions';
107
+ public method = 'post';
108
+
109
+ public static fetch(
110
+ data: {
111
+ subject: string;
112
+ schema: string | Record<string, any>;
113
+ schemaType?: string;
114
+ reference?: string;
115
+ normalize?: boolean;
116
+ },
117
+ ...args
118
+ ) {
119
+ return this._fetch<{ id: number }>(
120
+ {
121
+ path: { subject: data.subject },
122
+ params: { normalize: !!data.normalize },
123
+ data: {
124
+ schema: toStringData(data.schema),
125
+ schemaType: data.schemaType,
126
+ reference: data.reference,
127
+ },
128
+ },
129
+ ...args,
130
+ );
131
+ }
132
+ }
133
+
134
+ class PostSubjects extends SchemaRegistryApi {
135
+ public url = '/subjects/:subject';
136
+ public method = 'post';
137
+
138
+ public static fetch(
139
+ data: {
140
+ subject: string;
141
+ schema: string | Record<string, any>;
142
+ schemaType?: string;
143
+ reference?: string;
144
+ normalize?: boolean;
145
+ },
146
+ ...args
147
+ ) {
148
+ return this._fetch<{
149
+ subject: string;
150
+ id: number;
151
+ version: number;
152
+ schema: string;
153
+ }>(
154
+ {
155
+ path: { subject: data.subject },
156
+ params: { normalize: !!data.normalize },
157
+ data: {
158
+ schema: toStringData(data.schema),
159
+ schemaType: data.schemaType,
160
+ reference: data.reference,
161
+ },
162
+ },
163
+ ...args,
164
+ );
165
+ }
166
+ }
167
+
168
+ async function encode(
169
+ subject: string,
170
+ data: Record<string, any>,
171
+ version: string | number = 'latest',
172
+ ) {
173
+ const response = await GetSubjectsByVersion.fetch({ subject, version });
174
+ const header = Buffer.alloc(5);
175
+ const schema = Type.forSchema(JSON.parse(response.data.schema));
176
+ header.writeInt32BE(response.data.id, 1);
177
+ return Buffer.concat([header, schema.toBuffer(data)]);
178
+ }
179
+
180
+ async function decode(buffer: Buffer) {
181
+ const id = buffer.readInt32BE(1);
182
+ let data: Type = cache.get(id);
183
+ if (!data) {
184
+ const response = await GetSchemasById.fetch(id);
185
+ data = Type.forSchema(JSON.parse(response.data.schema));
186
+ cache.set(id, data);
187
+ }
188
+ const schema = Type.forSchema(data);
189
+ return schema.fromBuffer(buffer.slice(5));
190
+ }
191
+
192
+ function toStringData(data: string | Record<string, any>) {
193
+ return typeof data === 'string' ? data : JSON.stringify(data);
194
+ }
195
+
196
+ return {
197
+ ping: <typeof Ping.fetch>Ping.fetch.bind(Ping),
198
+ getSchemasById: <typeof GetSchemasById.fetch>(
199
+ GetSchemasById.fetch.bind(GetSchemasById)
200
+ ),
201
+ getSchemasTypes: <typeof GetSchemasTypes.fetch>(
202
+ GetSchemasTypes.fetch.bind(GetSchemasTypes)
203
+ ),
204
+ getSchemasVersionsById: <typeof GetSchemasVersionsById.fetch>(
205
+ GetSchemasVersionsById.fetch.bind(GetSchemasVersionsById)
206
+ ),
207
+ getSubjects: <typeof GetSubjects.fetch>GetSubjects.fetch.bind(GetSubjects),
208
+ getSubjectsVersions: <typeof GetSubjectsVersions.fetch>(
209
+ GetSubjectsVersions.fetch.bind(GetSubjectsVersions)
210
+ ),
211
+ deleteSubjects: <typeof DeleteSubjects.fetch>(
212
+ DeleteSubjects.fetch.bind(DeleteSubjects)
213
+ ),
214
+ getSubjectsByVersion: <typeof GetSubjectsByVersion.fetch>(
215
+ GetSubjectsByVersion.fetch.bind(GetSubjectsByVersion)
216
+ ),
217
+ getSchemaBySubjectsAndVersion: <typeof GetSchemaBySubjectsAndVersion.fetch>(
218
+ GetSchemaBySubjectsAndVersion.fetch.bind(GetSchemaBySubjectsAndVersion)
219
+ ),
220
+ postSubjects: <typeof PostSubjects.fetch>PostSubjects.fetch.bind(PostSubjects),
221
+ postSubjectsVersions: <typeof PostSubjectsVersions.fetch>(
222
+ PostSubjectsVersions.fetch.bind(PostSubjectsVersions)
223
+ ),
224
+ encode,
225
+ decode,
226
+ };
227
+ };
package/src/errors.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { BaseError } from '@biorate/errors';
2
+
3
+ export class SchemaRegistryCantConnectError extends BaseError {
4
+ public constructor(e: Error) {
5
+ super(`Can't connect to schema registry: [%s]`, [e.message]);
6
+ }
7
+ }
package/src/index.ts ADDED
@@ -0,0 +1,91 @@
1
+ import { injectable } from '@biorate/inversion';
2
+ import { ISchemaRegistryConfig, ISchemaRegistryConnection } from './interfaces';
3
+ import { Connector } from '@biorate/connector';
4
+ import { SchemaRegistryCantConnectError } from './errors';
5
+ import { create } from './api';
6
+ export * from './api';
7
+ export * from './errors';
8
+ export * from './interfaces';
9
+
10
+ /**
11
+ * @description Schema registry connector
12
+ *
13
+ * ### Features:
14
+ * - connector manager for schema registry
15
+ *
16
+ * @example
17
+ * ```
18
+ * import { inject, container, Types, Core } from '@biorate/inversion';
19
+ * import { IConfig, Config } from '@biorate/config';
20
+ * import { IConnector } from '@biorate/connector';
21
+ * import {
22
+ * SchemaRegistryConnector,
23
+ * ISchemaRegistryConnection,
24
+ * ISchemaRegistryConfig,
25
+ * } from '@biorate/schema-registry';
26
+ *
27
+ * export class Root extends Core() {
28
+ * @inject(SchemaRegistryConnector) public connector: IConnector<
29
+ * ISchemaRegistryConfig,
30
+ * ISchemaRegistryConnection
31
+ * >;
32
+ * }
33
+ *
34
+ * container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
35
+ * container
36
+ * .bind<SchemaRegistryConnector>(SchemaRegistryConnector)
37
+ * .toSelf()
38
+ * .inSingletonScope();
39
+ * container.bind<Root>(Root).toSelf().inSingletonScope();
40
+ *
41
+ * container.get<IConfig>(Types.Config).merge({
42
+ * SchemaRegistry: [{ name: 'connection', baseURL: 'http://localhost:8085' }],
43
+ * });
44
+ *
45
+ * (async () => {
46
+ * const root = container.get<Root>(Root);
47
+ * await root.$run();
48
+ *
49
+ * const { PostSubjectsVersions } = root.connector.connection('connection');
50
+ * const { data } = await PostSubjectsVersions.fetch({
51
+ * subject: 'test',
52
+ * schema: {
53
+ * type: 'record',
54
+ * name: 'Test',
55
+ * namespace: 'test',
56
+ * fields: [
57
+ * {
58
+ * name: 'firstName',
59
+ * type: 'string',
60
+ * },
61
+ * {
62
+ * name: 'lastName',
63
+ * type: 'string',
64
+ * },
65
+ * {
66
+ * name: 'age',
67
+ * type: 'int',
68
+ * },
69
+ * ],
70
+ * },
71
+ * });
72
+ * console.log(data); // { id: 1 }
73
+ * })();
74
+ * ```
75
+ */
76
+ @injectable()
77
+ export class SchemaRegistryConnector extends Connector<
78
+ ISchemaRegistryConfig,
79
+ ISchemaRegistryConnection
80
+ > {
81
+ protected readonly namespace = 'SchemaRegistry';
82
+ protected async connect(config) {
83
+ const connection = create(config);
84
+ try {
85
+ await connection.ping();
86
+ } catch (e) {
87
+ throw new SchemaRegistryCantConnectError(e);
88
+ }
89
+ return connection;
90
+ }
91
+ }
@@ -0,0 +1,8 @@
1
+ import { IConnectorConfig, IConnector } from '@biorate/connector';
2
+ import { create } from './api';
3
+
4
+ export type ISchemaRegistryConnection = ReturnType<typeof create>;
5
+
6
+ export interface ISchemaRegistryConfig extends IConnectorConfig {
7
+ baseURL: string;
8
+ }
@@ -0,0 +1,30 @@
1
+ import { use } from 'chai';
2
+ import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot';
3
+ import { IConnector } from '@biorate/connector';
4
+ import { inject, container, Types, Core } from '@biorate/inversion';
5
+ import { IConfig, Config } from '@biorate/config';
6
+ import {
7
+ SchemaRegistryConnector,
8
+ ISchemaRegistryConnection,
9
+ ISchemaRegistryConfig,
10
+ } from '../../src';
11
+
12
+ use(jestSnapshotPlugin());
13
+
14
+ export class Root extends Core() {
15
+ @inject(SchemaRegistryConnector) public connector: IConnector<
16
+ ISchemaRegistryConfig,
17
+ ISchemaRegistryConnection
18
+ >;
19
+ }
20
+
21
+ container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
22
+ container
23
+ .bind<SchemaRegistryConnector>(SchemaRegistryConnector)
24
+ .toSelf()
25
+ .inSingletonScope();
26
+ container.bind<Root>(Root).toSelf().inSingletonScope();
27
+
28
+ container.get<IConfig>(Types.Config).merge({
29
+ SchemaRegistry: [{ name: 'connection', baseURL: 'http://localhost:8085' }],
30
+ });
@@ -0,0 +1,15 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`@biorate/schema-registry getSchemasTypes 1`] = `
4
+ Array [
5
+ "JSON",
6
+ "PROTOBUF",
7
+ "AVRO",
8
+ ]
9
+ `;
10
+
11
+ exports[`@biorate/schema-registry getSubjects 1`] = `
12
+ Array [
13
+ "test",
14
+ ]
15
+ `;
@@ -0,0 +1,98 @@
1
+ import { expect } from 'chai';
2
+ import { container } from '@biorate/inversion';
3
+ import { Root } from './__mocks__';
4
+ import * as schema from './test.avsc.json';
5
+
6
+ describe('@biorate/schema-registry', function () {
7
+ let root: Root,
8
+ version: number,
9
+ subject = 'test';
10
+ this.timeout(3e4);
11
+
12
+ before(async () => {
13
+ root = container.get<Root>(Root);
14
+ await root.$run();
15
+ });
16
+
17
+ it('getPing', async () => {
18
+ const { ping } = root.connector.connection('connection');
19
+ const { data } = await ping();
20
+ expect(data).to.be.a('object');
21
+ });
22
+
23
+ it('postSubjectsVersions', async () => {
24
+ const { postSubjectsVersions } = root.connector.connection('connection');
25
+ const { data } = await postSubjectsVersions({ subject, schema });
26
+ expect(data).to.has.property('id').that.be.a('number');
27
+ });
28
+
29
+ it('postSubjects', async () => {
30
+ const { postSubjects } = root.connector.connection('connection');
31
+ const { data } = await postSubjects({ subject, schema });
32
+ expect(data).to.has.property('subject').that.be.a('string');
33
+ expect(data).to.has.property('id').that.be.a('number');
34
+ expect(data).to.has.property('version').that.be.a('number');
35
+ expect(data).to.has.property('schema').that.be.a('string');
36
+ });
37
+
38
+ it('getSchemasById', async () => {
39
+ const { getSchemasById } = root.connector.connection('connection');
40
+ const { data } = await getSchemasById(1);
41
+ expect(data).to.has.property('schema').that.be.a('string');
42
+ });
43
+
44
+ it('getSchemasTypes', async () => {
45
+ const { getSchemasTypes } = root.connector.connection('connection');
46
+ const { data } = await getSchemasTypes();
47
+ expect(data).toMatchSnapshot();
48
+ });
49
+
50
+ it('getSchemasVersionsById', async () => {
51
+ const { getSchemasVersionsById } = root.connector.connection('connection');
52
+ const { data } = await getSchemasVersionsById(1);
53
+ expect(data[0]).to.has.property('subject').that.be.a('string');
54
+ expect(data[0]).to.has.property('version').that.be.a('number');
55
+ });
56
+
57
+ it('getSubjects', async () => {
58
+ const { getSubjects } = root.connector.connection('connection');
59
+ const { data } = await getSubjects();
60
+ expect(data).toMatchSnapshot();
61
+ });
62
+
63
+ it('getSubjectsVersions', async () => {
64
+ const { getSubjectsVersions } = root.connector.connection('connection');
65
+ const { data } = await getSubjectsVersions(subject);
66
+ expect(data[0]).to.be.a('number');
67
+ [version] = data;
68
+ });
69
+
70
+ it('getSubjectsByVersion', async () => {
71
+ const { getSubjectsByVersion } = root.connector.connection('connection');
72
+ const { data } = await getSubjectsByVersion({
73
+ subject,
74
+ version,
75
+ });
76
+ expect(data).to.has.property('subject').that.be.a('string');
77
+ expect(data).to.has.property('id').that.be.a('number');
78
+ expect(data).to.has.property('version').that.be.a('number');
79
+ expect(data).to.has.property('schema').that.be.a('string');
80
+ });
81
+
82
+ it('encode / decode', async () => {
83
+ const { encode, decode } = root.connector.connection('connection');
84
+ const data = { firstName: 'Vasya', lastName: 'Pupkin', age: 18 };
85
+ const buffer = await encode(subject, data);
86
+ const result = await decode(buffer);
87
+ expect(JSON.parse(JSON.stringify(result))).to.be.deep.equal(data);
88
+ });
89
+
90
+ it('deleteSubjects', async () => {
91
+ const { deleteSubjects } = root.connector.connection('connection');
92
+ const { data } = await deleteSubjects({
93
+ subject,
94
+ permanent: false,
95
+ });
96
+ expect(data[0]).to.be.a('number');
97
+ });
98
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "type": "record",
3
+ "name": "Test",
4
+ "namespace": "test",
5
+ "fields": [
6
+ {
7
+ "name": "firstName",
8
+ "type": "string"
9
+ },
10
+ {
11
+ "name": "lastName",
12
+ "type": "string"
13
+ },
14
+ {
15
+ "name": "age",
16
+ "type": "int"
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": ["index.ts", "src/**/*"],
4
+ "exclude": ["node_modules", "dist", "tests", "**/*spec.ts"]
5
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {},
4
+ "include": ["index.ts", "src/**/*", "tests/**/*"],
5
+ "exclude": ["node_modules", "dist"]
6
+ }