@golemio/core 1.3.1-dev.743035340 → 1.3.1-dev.753243556
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/README.md +14 -15
- package/dist/helpers/data-access/feature-flags/FeatureFlagServiceFactory.d.ts +13 -0
- package/dist/helpers/data-access/feature-flags/FeatureFlagServiceFactory.js +33 -0
- package/dist/helpers/data-access/feature-flags/FeatureFlagServiceFactory.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.d.ts +10 -0
- package/dist/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.js +27 -0
- package/dist/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/helpers/index.d.ts +1 -0
- package/dist/helpers/data-access/feature-flags/helpers/index.js +18 -0
- package/dist/helpers/data-access/feature-flags/helpers/index.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/index.d.ts +4 -0
- package/dist/helpers/data-access/feature-flags/index.js +21 -0
- package/dist/helpers/data-access/feature-flags/index.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/interfaces/IFeatureFlagService.d.ts +5 -0
- package/dist/helpers/data-access/feature-flags/interfaces/IFeatureFlagService.js +3 -0
- package/dist/helpers/data-access/feature-flags/interfaces/IFeatureFlagService.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/interfaces/IFeatureFlagsConfig.d.ts +7 -0
- package/dist/helpers/data-access/feature-flags/interfaces/IFeatureFlagsConfig.js +3 -0
- package/dist/helpers/data-access/feature-flags/interfaces/IFeatureFlagsConfig.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/providers/AbstractFeatureFlagService.d.ts +6 -0
- package/dist/helpers/data-access/feature-flags/providers/AbstractFeatureFlagService.js +7 -0
- package/dist/helpers/data-access/feature-flags/providers/AbstractFeatureFlagService.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/providers/LaunchDarklyFeatureFlagService.d.ts +13 -0
- package/dist/helpers/data-access/feature-flags/providers/LaunchDarklyFeatureFlagService.js +76 -0
- package/dist/helpers/data-access/feature-flags/providers/LaunchDarklyFeatureFlagService.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/providers/NoopFeatureFlagService.d.ts +10 -0
- package/dist/helpers/data-access/feature-flags/providers/NoopFeatureFlagService.js +39 -0
- package/dist/helpers/data-access/feature-flags/providers/NoopFeatureFlagService.js.map +1 -0
- package/dist/helpers/data-access/feature-flags/providers/interfaces/LaunchDarklyInterfaces.d.ts +22 -0
- package/dist/helpers/data-access/feature-flags/providers/interfaces/LaunchDarklyInterfaces.js +3 -0
- package/dist/helpers/data-access/feature-flags/providers/interfaces/LaunchDarklyInterfaces.js.map +1 -0
- package/dist/input-gateway/config/InputGatewayConfiguration.d.ts +2 -0
- package/dist/input-gateway/config/InputGatewayConfiguration.js +21 -1
- package/dist/input-gateway/config/InputGatewayConfiguration.js.map +1 -1
- package/dist/input-gateway/data-access/FeatureFlagServiceWrapper.d.ts +9 -0
- package/dist/input-gateway/data-access/FeatureFlagServiceWrapper.js +39 -0
- package/dist/input-gateway/data-access/FeatureFlagServiceWrapper.js.map +1 -0
- package/dist/input-gateway/data-access/index.d.ts +6 -0
- package/dist/input-gateway/data-access/index.js +10 -0
- package/dist/input-gateway/data-access/index.js.map +1 -0
- package/dist/input-gateway/ioc/ContainerToken.d.ts +2 -0
- package/dist/input-gateway/ioc/ContainerToken.js +2 -0
- package/dist/input-gateway/ioc/ContainerToken.js.map +1 -1
- package/dist/input-gateway/ioc/Di.js +6 -1
- package/dist/input-gateway/ioc/Di.js.map +1 -1
- package/dist/integration-engine/config/IntegrationEngineConfiguration.d.ts +2 -0
- package/dist/integration-engine/config/IntegrationEngineConfiguration.js +21 -0
- package/dist/integration-engine/config/IntegrationEngineConfiguration.js.map +1 -1
- package/dist/integration-engine/data-access/FeatureFlagServiceWrapper.d.ts +9 -0
- package/dist/integration-engine/data-access/FeatureFlagServiceWrapper.js +39 -0
- package/dist/integration-engine/data-access/FeatureFlagServiceWrapper.js.map +1 -0
- package/dist/integration-engine/data-access/index.d.ts +6 -1
- package/dist/integration-engine/data-access/index.js +6 -1
- package/dist/integration-engine/data-access/index.js.map +1 -1
- package/dist/integration-engine/ioc/ContainerToken.d.ts +2 -0
- package/dist/integration-engine/ioc/ContainerToken.js +2 -0
- package/dist/integration-engine/ioc/ContainerToken.js.map +1 -1
- package/dist/integration-engine/ioc/Di.js +6 -1
- package/dist/integration-engine/ioc/Di.js.map +1 -1
- package/dist/output-gateway/config/OutputGatewayConfiguration.d.ts +2 -0
- package/dist/output-gateway/config/OutputGatewayConfiguration.js +22 -2
- package/dist/output-gateway/config/OutputGatewayConfiguration.js.map +1 -1
- package/dist/output-gateway/data-access/FeatureFlagServiceWrapper.d.ts +9 -0
- package/dist/output-gateway/data-access/FeatureFlagServiceWrapper.js +39 -0
- package/dist/output-gateway/data-access/FeatureFlagServiceWrapper.js.map +1 -0
- package/dist/output-gateway/data-access/index.d.ts +5 -0
- package/dist/output-gateway/data-access/index.js +9 -0
- package/dist/output-gateway/data-access/index.js.map +1 -0
- package/dist/output-gateway/database/index.d.ts +0 -25
- package/dist/output-gateway/ioc/ContainerToken.d.ts +2 -0
- package/dist/output-gateway/ioc/ContainerToken.js +2 -0
- package/dist/output-gateway/ioc/ContainerToken.js.map +1 -1
- package/dist/output-gateway/ioc/Di.js +6 -1
- package/dist/output-gateway/ioc/Di.js.map +1 -1
- package/dist/output-gateway/models/MongoModel.d.ts +25 -1
- package/dist/schema-definitions/ErrorLog.d.ts +0 -25
- package/package.json +13 -6
package/README.md
CHANGED
|
@@ -36,7 +36,6 @@ This module is intended for use with Golemio services.
|
|
|
36
36
|
- Mongo (https://www.mongodb.com)
|
|
37
37
|
- Postgres (https://www.postgresql.org/)
|
|
38
38
|
- Redis (https://redis.io/)
|
|
39
|
-
- yarn (https://yarnpkg.com)
|
|
40
39
|
- TypeScript (https://www.typescriptlang.org/)
|
|
41
40
|
- Golemio Schema Definitions
|
|
42
41
|
|
|
@@ -47,7 +46,7 @@ Install all prerequisites
|
|
|
47
46
|
Install all dependencies using command:
|
|
48
47
|
|
|
49
48
|
```bash
|
|
50
|
-
|
|
49
|
+
npm install
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
from the application's root directory.
|
|
@@ -57,13 +56,13 @@ from the application's root directory.
|
|
|
57
56
|
To compile typescript code into js one-time
|
|
58
57
|
|
|
59
58
|
```bash
|
|
60
|
-
|
|
59
|
+
npm run build
|
|
61
60
|
```
|
|
62
61
|
|
|
63
62
|
or run this, to watch all changes
|
|
64
63
|
|
|
65
64
|
```bash
|
|
66
|
-
|
|
65
|
+
npm run build-watch
|
|
67
66
|
```
|
|
68
67
|
|
|
69
68
|
from the application's root directory.
|
|
@@ -73,7 +72,7 @@ from the application's root directory.
|
|
|
73
72
|
In your project's `package.json` set dependency to @golemio/core
|
|
74
73
|
|
|
75
74
|
```bash
|
|
76
|
-
|
|
75
|
+
npm install --save @golemio/core
|
|
77
76
|
```
|
|
78
77
|
|
|
79
78
|
Then import module, e.g.
|
|
@@ -84,29 +83,29 @@ import * as core from "@golemio/core";
|
|
|
84
83
|
|
|
85
84
|
### Local development
|
|
86
85
|
|
|
87
|
-
For the local development use the [
|
|
86
|
+
For the local development use the [npm link]() to link the @golemio/core with other service e.g. `@golemio/integration-engine` or module e.g. `@golemio/pid`.
|
|
88
87
|
|
|
89
88
|
At the @golemio/core root directory:
|
|
90
89
|
|
|
91
90
|
```bash
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
npm link
|
|
92
|
+
npm run build-watch
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
At the @golemio/pid root directory:
|
|
97
96
|
|
|
98
97
|
```bash
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
npm link "@golemio/core"
|
|
99
|
+
npm link
|
|
100
|
+
npm run build-watch
|
|
102
101
|
```
|
|
103
102
|
|
|
104
103
|
At the @golemio/integration-engine root directory:
|
|
105
104
|
|
|
106
105
|
```bash
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
npm link "@golemio/core"
|
|
107
|
+
npm link "@golemio/pid"
|
|
108
|
+
npm run dev-start
|
|
110
109
|
```
|
|
111
110
|
|
|
112
111
|
Now you can change code and immediately see the results.
|
|
@@ -116,7 +115,7 @@ Now you can change code and immediately see the results.
|
|
|
116
115
|
To run all test defined in /test directory simply run this command:
|
|
117
116
|
|
|
118
117
|
```bash
|
|
119
|
-
|
|
118
|
+
npm run test
|
|
120
119
|
```
|
|
121
120
|
|
|
122
121
|
from the application's root directory. All tests should pass.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILogger } from "../../logger";
|
|
2
|
+
import { IFeatureFlagsConfig } from "./interfaces/IFeatureFlagsConfig";
|
|
3
|
+
import { AbstractFeatureFlagService } from "./providers/AbstractFeatureFlagService";
|
|
4
|
+
export declare enum FeatureFlagsProvider {
|
|
5
|
+
Noop = "Noop",
|
|
6
|
+
LaunchDarkly = "LaunchDarkly"
|
|
7
|
+
}
|
|
8
|
+
export declare class FeatureFlagServiceFactory {
|
|
9
|
+
private config;
|
|
10
|
+
private dictionary;
|
|
11
|
+
constructor(config: IFeatureFlagsConfig, log: ILogger);
|
|
12
|
+
getService(provider: FeatureFlagsProvider): AbstractFeatureFlagService | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeatureFlagServiceFactory = exports.FeatureFlagsProvider = void 0;
|
|
4
|
+
const LaunchDarklyFeatureFlagService_1 = require("./providers/LaunchDarklyFeatureFlagService");
|
|
5
|
+
const NoopFeatureFlagService_1 = require("./providers/NoopFeatureFlagService");
|
|
6
|
+
var FeatureFlagsProvider;
|
|
7
|
+
(function (FeatureFlagsProvider) {
|
|
8
|
+
FeatureFlagsProvider["Noop"] = "Noop";
|
|
9
|
+
FeatureFlagsProvider["LaunchDarkly"] = "LaunchDarkly";
|
|
10
|
+
})(FeatureFlagsProvider = exports.FeatureFlagsProvider || (exports.FeatureFlagsProvider = {}));
|
|
11
|
+
class FeatureFlagServiceFactory {
|
|
12
|
+
constructor(config, log) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.dictionary = new Map();
|
|
15
|
+
if (config.enabled) {
|
|
16
|
+
this.dictionary.set(FeatureFlagsProvider.LaunchDarkly, new LaunchDarklyFeatureFlagService_1.LaunchDarklyFeatureFlagService(config.provider.launchDarkly, log));
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
log.silly("[FeatureFlagServiceFactory] Feature flags are disabled");
|
|
20
|
+
this.dictionary.set(FeatureFlagsProvider.Noop, new NoopFeatureFlagService_1.NoopFeatureFlagService(log));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
getService(provider) {
|
|
24
|
+
if (this.config.enabled) {
|
|
25
|
+
return this.dictionary.get(provider);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return this.dictionary.get(FeatureFlagsProvider.Noop);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.FeatureFlagServiceFactory = FeatureFlagServiceFactory;
|
|
33
|
+
//# sourceMappingURL=FeatureFlagServiceFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureFlagServiceFactory.js","sourceRoot":"","sources":["../../../../src/helpers/data-access/feature-flags/FeatureFlagServiceFactory.ts"],"names":[],"mappings":";;;AAGA,+FAA4F;AAC5F,+EAA4E;AAE5E,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,qDAA6B,CAAA;AACjC,CAAC,EAHW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAG/B;AAED,MAAa,yBAAyB;IAGlC,YAAoB,MAA2B,EAAE,GAAY;QAAzC,WAAM,GAAN,MAAM,CAAqB;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAE5B,IAAI,MAAM,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,oBAAoB,CAAC,YAAY,EACjC,IAAI,+DAA8B,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAa,EAAE,GAAG,CAAC,CACzE,CAAC;SACL;aAAM;YACH,GAAG,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;YACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,+CAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;SACnF;IACL,CAAC;IAEM,UAAU,CAAC,QAA8B;QAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACrB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SACxC;aAAM;YACH,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;SACzD;IACL,CAAC;CACJ;AAxBD,8DAwBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IFeatureFlagService } from "./..";
|
|
2
|
+
import { Disposable } from "tsyringe";
|
|
3
|
+
/**
|
|
4
|
+
* Abstract wrapper of the feature flag service for dependency injection
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class AbstractFeatureFlagServiceWrapper implements Disposable {
|
|
7
|
+
protected abstract _service: IFeatureFlagService;
|
|
8
|
+
get service(): IFeatureFlagService;
|
|
9
|
+
dispose(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AbstractFeatureFlagServiceWrapper = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Abstract wrapper of the feature flag service for dependency injection
|
|
15
|
+
*/
|
|
16
|
+
class AbstractFeatureFlagServiceWrapper {
|
|
17
|
+
get service() {
|
|
18
|
+
return this._service;
|
|
19
|
+
}
|
|
20
|
+
dispose() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
yield this._service.disconnect();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.AbstractFeatureFlagServiceWrapper = AbstractFeatureFlagServiceWrapper;
|
|
27
|
+
//# sourceMappingURL=AbstractFeatureFlagServiceWrapper.js.map
|
package/dist/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractFeatureFlagServiceWrapper.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/helpers/AbstractFeatureFlagServiceWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA;;GAEG;AACH,MAAsB,iCAAiC;IAGnD,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAEY,OAAO;;YAChB,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACrC,CAAC;KAAA;CACJ;AAVD,8EAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AbstractFeatureFlagServiceWrapper";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AbstractFeatureFlagServiceWrapper"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./providers/AbstractFeatureFlagService"), exports);
|
|
18
|
+
__exportStar(require("./interfaces/IFeatureFlagsConfig"), exports);
|
|
19
|
+
__exportStar(require("./interfaces/IFeatureFlagService"), exports);
|
|
20
|
+
__exportStar(require("./FeatureFlagServiceFactory"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/data-access/feature-flags/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yEAAuD;AACvD,mEAAiD;AACjD,mEAAiD;AACjD,8DAA4C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFeatureFlagService.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/interfaces/IFeatureFlagService.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFeatureFlagsConfig.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/interfaces/IFeatureFlagsConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IFeatureFlagService } from "../interfaces/IFeatureFlagService";
|
|
2
|
+
export declare abstract class AbstractFeatureFlagService implements IFeatureFlagService {
|
|
3
|
+
abstract connect(): Promise<void>;
|
|
4
|
+
abstract disconnect(): Promise<void>;
|
|
5
|
+
abstract isFeatureEnabled(flagKey: string, defaultValue?: boolean): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractFeatureFlagService = void 0;
|
|
4
|
+
class AbstractFeatureFlagService {
|
|
5
|
+
}
|
|
6
|
+
exports.AbstractFeatureFlagService = AbstractFeatureFlagService;
|
|
7
|
+
//# sourceMappingURL=AbstractFeatureFlagService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractFeatureFlagService.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/providers/AbstractFeatureFlagService.ts"],"names":[],"mappings":";;;AAEA,MAAsB,0BAA0B;CAI/C;AAJD,gEAIC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILogger } from "../../../logger";
|
|
2
|
+
import { IFeatureFlagService } from "../interfaces/IFeatureFlagService";
|
|
3
|
+
import { AbstractFeatureFlagService } from "./AbstractFeatureFlagService";
|
|
4
|
+
import { LaunchDarklyConfig } from "./interfaces/LaunchDarklyInterfaces";
|
|
5
|
+
export declare class LaunchDarklyFeatureFlagService extends AbstractFeatureFlagService implements IFeatureFlagService {
|
|
6
|
+
private readonly client;
|
|
7
|
+
constructor(config: LaunchDarklyConfig, log: ILogger);
|
|
8
|
+
connect(): Promise<void>;
|
|
9
|
+
disconnect(): Promise<void>;
|
|
10
|
+
isFeatureEnabled(flagKey: string, defaultValue?: boolean): Promise<boolean>;
|
|
11
|
+
private getProxyModeOptions;
|
|
12
|
+
private getDaemonModeOptions;
|
|
13
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LaunchDarklyFeatureFlagService = void 0;
|
|
16
|
+
const launchdarkly_node_server_sdk_1 = __importDefault(require("launchdarkly-node-server-sdk"));
|
|
17
|
+
const launchdarkly_node_server_sdk_redis_1 = require("launchdarkly-node-server-sdk-redis");
|
|
18
|
+
const integrations_1 = require("launchdarkly-node-server-sdk/integrations");
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const AbstractFeatureFlagService_1 = require("./AbstractFeatureFlagService");
|
|
21
|
+
class LaunchDarklyFeatureFlagService extends AbstractFeatureFlagService_1.AbstractFeatureFlagService {
|
|
22
|
+
constructor(config, log) {
|
|
23
|
+
super();
|
|
24
|
+
let options = {
|
|
25
|
+
application: { id: config.appId },
|
|
26
|
+
offline: !!config.useOfflineMode,
|
|
27
|
+
logger: log,
|
|
28
|
+
};
|
|
29
|
+
if (config.useDaemonMode) {
|
|
30
|
+
options = Object.assign(Object.assign({}, options), this.getDaemonModeOptions(config));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
options = Object.assign(Object.assign({}, options), this.getProxyModeOptions(config));
|
|
34
|
+
}
|
|
35
|
+
if (config.fileDataSource) {
|
|
36
|
+
log.warn(`[${this.constructor.name}] Loading feature flags from file ${config.fileDataSource}`);
|
|
37
|
+
options.updateProcessor = (0, integrations_1.FileDataSource)({
|
|
38
|
+
paths: [path_1.default.resolve(process.cwd(), config.fileDataSource)],
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
this.client = launchdarkly_node_server_sdk_1.default.init(config.sdkKey, options);
|
|
42
|
+
}
|
|
43
|
+
connect() {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
yield this.client.waitForInitialization();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
disconnect() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return this.client.close();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
isFeatureEnabled(flagKey, defaultValue = false) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
return !!(yield this.client.variation(flagKey, { kind: "multi" }, defaultValue));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getProxyModeOptions(config) {
|
|
59
|
+
return {
|
|
60
|
+
baseUri: config.options.baseUri,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
getDaemonModeOptions(config) {
|
|
64
|
+
return {
|
|
65
|
+
// Enable daemon mode
|
|
66
|
+
useLdd: true,
|
|
67
|
+
featureStore: (0, launchdarkly_node_server_sdk_redis_1.RedisFeatureStore)({
|
|
68
|
+
redisOpts: { url: config.options.redisConn },
|
|
69
|
+
prefix: config.options.redisKeyPrefix,
|
|
70
|
+
cacheTTL: config.options.redisCacheTtlInSeconds,
|
|
71
|
+
}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.LaunchDarklyFeatureFlagService = LaunchDarklyFeatureFlagService;
|
|
76
|
+
//# sourceMappingURL=LaunchDarklyFeatureFlagService.js.map
|
package/dist/helpers/data-access/feature-flags/providers/LaunchDarklyFeatureFlagService.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchDarklyFeatureFlagService.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/providers/LaunchDarklyFeatureFlagService.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,KAAK;;YAC/D,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;QACrF,CAAC;KAAA;IAEO,mBAAmB,CAAC,MAAwB;QAChD,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO;SAClC,CAAC;IACN,CAAC;IAEO,oBAAoB,CAAC,MAAyB;QAClD,OAAO;YACH,qBAAqB;YACrB,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAA,sDAAiB,EAAC;gBAC5B,SAAS,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE;gBAC5C,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,cAAc;gBACrC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,sBAAsB;aAClD,CAAC;SACL,CAAC;IACN,CAAC;CACJ;AA/DD,wEA+DC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ILogger } from "../../../logger";
|
|
2
|
+
import { IFeatureFlagService } from "../interfaces/IFeatureFlagService";
|
|
3
|
+
import { AbstractFeatureFlagService } from "./AbstractFeatureFlagService";
|
|
4
|
+
export declare class NoopFeatureFlagService extends AbstractFeatureFlagService implements IFeatureFlagService {
|
|
5
|
+
private readonly log;
|
|
6
|
+
constructor(log: ILogger);
|
|
7
|
+
connect(): Promise<void>;
|
|
8
|
+
disconnect(): Promise<void>;
|
|
9
|
+
isFeatureEnabled(_flagKey: string, defaultValue?: boolean): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NoopFeatureFlagService = void 0;
|
|
13
|
+
const AbstractFeatureFlagService_1 = require("./AbstractFeatureFlagService");
|
|
14
|
+
class NoopFeatureFlagService extends AbstractFeatureFlagService_1.AbstractFeatureFlagService {
|
|
15
|
+
constructor(log) {
|
|
16
|
+
super();
|
|
17
|
+
this.log = log;
|
|
18
|
+
}
|
|
19
|
+
connect() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
this.log.silly(`[${this.constructor.name}] Feature flags are disabled`);
|
|
22
|
+
return Promise.resolve();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
disconnect() {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
this.log.silly(`[${this.constructor.name}] Feature flags are disabled`);
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
isFeatureEnabled(_flagKey, defaultValue = false) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
this.log.silly(`[${this.constructor.name}] Feature flags are disabled`);
|
|
34
|
+
return defaultValue;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.NoopFeatureFlagService = NoopFeatureFlagService;
|
|
39
|
+
//# sourceMappingURL=NoopFeatureFlagService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoopFeatureFlagService.js","sourceRoot":"","sources":["../../../../../src/helpers/data-access/feature-flags/providers/NoopFeatureFlagService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6EAA0E;AAE1E,MAAa,sBAAuB,SAAQ,uDAA0B;IAClE,YAA6B,GAAY;QACrC,KAAK,EAAE,CAAC;QADiB,QAAG,GAAH,GAAG,CAAS;IAEzC,CAAC;IAEY,OAAO;;YAChB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,8BAA8B,CAAC,CAAC;YACxE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC;KAAA;IAEY,UAAU;;YACnB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,8BAA8B,CAAC,CAAC;YACxE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC;KAAA;IAEY,gBAAgB,CAAC,QAAgB,EAAE,YAAY,GAAG,KAAK;;YAChE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,8BAA8B,CAAC,CAAC;YACxE,OAAO,YAAY,CAAC;QACxB,CAAC;KAAA;CACJ;AAnBD,wDAmBC"}
|
package/dist/helpers/data-access/feature-flags/providers/interfaces/LaunchDarklyInterfaces.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface IBaseConfig {
|
|
2
|
+
appId: string;
|
|
3
|
+
sdkKey: string;
|
|
4
|
+
useOfflineMode?: boolean;
|
|
5
|
+
fileDataSource?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IProxyModeConfig extends IBaseConfig {
|
|
8
|
+
useDaemonMode: false;
|
|
9
|
+
options: {
|
|
10
|
+
baseUri: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface IDaemonModeConfig extends IBaseConfig {
|
|
14
|
+
useDaemonMode: true;
|
|
15
|
+
options: {
|
|
16
|
+
redisConn: string;
|
|
17
|
+
redisCacheTtlInSeconds: number;
|
|
18
|
+
redisKeyPrefix: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare type LaunchDarklyConfig = IProxyModeConfig | IDaemonModeConfig;
|
|
22
|
+
export {};
|
package/dist/helpers/data-access/feature-flags/providers/interfaces/LaunchDarklyInterfaces.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchDarklyInterfaces.js","sourceRoot":"","sources":["../../../../../../src/helpers/data-access/feature-flags/providers/interfaces/LaunchDarklyInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IFeatureFlagsConfig } from "../../helpers/data-access/feature-flags";
|
|
1
2
|
import { JaegerProcessorType } from "../../monitoring";
|
|
2
3
|
import { IConfiguration } from "./abstract";
|
|
3
4
|
export declare class InputGatewayConfiguration implements IConfiguration {
|
|
@@ -48,5 +49,6 @@ export declare class InputGatewayConfiguration implements IConfiguration {
|
|
|
48
49
|
shutdownTimeout: number;
|
|
49
50
|
handlerTimeout: number;
|
|
50
51
|
};
|
|
52
|
+
featureFlags: IFeatureFlagsConfig;
|
|
51
53
|
constructor();
|
|
52
54
|
}
|
|
@@ -16,7 +16,7 @@ const _monitoring_1 = require("../../monitoring");
|
|
|
16
16
|
const tsyringe_1 = require("tsyringe");
|
|
17
17
|
let InputGatewayConfiguration = class InputGatewayConfiguration {
|
|
18
18
|
constructor() {
|
|
19
|
-
var _a;
|
|
19
|
+
var _a, _b, _c, _d, _e;
|
|
20
20
|
this.app_version = process.env.npm_package_version;
|
|
21
21
|
this.app_name = process.env.APP_NAME || "input-gateway";
|
|
22
22
|
this.colorful_logs = process.env.COLORFUL_LOGS;
|
|
@@ -65,6 +65,26 @@ let InputGatewayConfiguration = class InputGatewayConfiguration {
|
|
|
65
65
|
shutdownTimeout: process.env.LIGHTSHIP_SHUTDOWN_TIMEOUT ? parseInt(process.env.LIGHTSHIP_SHUTDOWN_TIMEOUT, 10) : 60000,
|
|
66
66
|
handlerTimeout: process.env.LIGHTSHIP_HANDLER_TIMEOUT ? parseInt(process.env.LIGHTSHIP_HANDLER_TIMEOUT, 10) : 5000,
|
|
67
67
|
};
|
|
68
|
+
this.featureFlags = {
|
|
69
|
+
enabled: process.env.FEATURE_FLAGS_ENABLED === "true",
|
|
70
|
+
provider: {
|
|
71
|
+
launchDarkly: {
|
|
72
|
+
appId: (_b = process.env.FEATURE_FLAGS_LAUNCH_DARKLY_APP_ID) !== null && _b !== void 0 ? _b : "input-gateway",
|
|
73
|
+
sdkKey: (_c = process.env.FEATURE_FLAGS_LAUNCH_DARKLY_SDK_KEY) !== null && _c !== void 0 ? _c : "sdk-test",
|
|
74
|
+
useOfflineMode: process.env.FEATURE_FLAGS_LAUNCH_DARKLY_USE_OFFLINE_MODE === "true",
|
|
75
|
+
fileDataSource: process.env.FEATURE_FLAGS_LAUNCH_DARKLY_FILE_DATA_SOURCE,
|
|
76
|
+
useDaemonMode: process.env.FEATURE_FLAGS_LAUNCH_DARKLY_USE_DAEMON_MODE === "true",
|
|
77
|
+
options: {
|
|
78
|
+
baseUri: (_d = process.env.FEATURE_FLAGS_LAUNCH_DARKLY_BASE_URI) !== null && _d !== void 0 ? _d : "http://localhost:8030",
|
|
79
|
+
redisConn: process.env.FEATURE_FLAGS_LAUNCH_DARKLY_REDIS_CONN,
|
|
80
|
+
redisCacheTtlInSeconds: process.env.FEATURE_FLAGS_LAUNCH_DARKLY_REDIS_CACHE_TTL_IN_SECONDS
|
|
81
|
+
? parseInt(process.env.FEATURE_FLAGS_LAUNCH_DARKLY_REDIS_CACHE_TTL_IN_SECONDS)
|
|
82
|
+
: 60,
|
|
83
|
+
redisKeyPrefix: (_e = process.env.FEATURE_FLAGS_LAUNCH_DARKLY_REDIS_KEY_PREFIX) !== null && _e !== void 0 ? _e : "ld-ig",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
};
|
|
68
88
|
const saveRawDataWhitelist = new _helpers_1.ConfigLoader("saveRawDataWhitelist").conf;
|
|
69
89
|
this.saveRawDataWhitelist = (0, utils_1.isEmpty)(saveRawDataWhitelist) ? [] : saveRawDataWhitelist;
|
|
70
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGatewayConfiguration.js","sourceRoot":"","sources":["../../../src/input-gateway/config/InputGatewayConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwC;
|
|
1
|
+
{"version":3,"file":"InputGatewayConfiguration.js","sourceRoot":"","sources":["../../../src/input-gateway/config/InputGatewayConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwC;AAExC,+CAAyC;AACzC,kDAAkD;AAClD,uCAAsC;AAItC,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IAwElC;;QAvEO,gBAAW,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAC9C,aAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,eAAe,CAAC;QACnD,kBAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QAC1C,cAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QAClC,aAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;QACjD,sBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAClD,uBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QACpD,sBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAClD,SAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACxB,uBAAkB,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,WAAW,0CAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QACzD,yBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACxD,OAAE,GAAG;YACR,aAAa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
|
+
import { AbstractFeatureFlagServiceWrapper } from "../../helpers/data-access/feature-flags/helpers";
|
|
3
|
+
import { ILogger } from "../../helpers/logger";
|
|
4
|
+
import { InputGatewayConfiguration } from "../config/InputGatewayConfiguration";
|
|
5
|
+
import { Disposable } from "tsyringe";
|
|
6
|
+
export declare class FeatureFlagServiceWrapper extends AbstractFeatureFlagServiceWrapper implements Disposable {
|
|
7
|
+
protected _service: IFeatureFlagService;
|
|
8
|
+
constructor(config: InputGatewayConfiguration, log: ILogger);
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.FeatureFlagServiceWrapper = void 0;
|
|
16
|
+
const feature_flags_1 = require("../../helpers/data-access/feature-flags");
|
|
17
|
+
const helpers_1 = require("../../helpers/data-access/feature-flags/helpers");
|
|
18
|
+
const InputGatewayConfiguration_1 = require("../config/InputGatewayConfiguration");
|
|
19
|
+
const ContainerToken_1 = require("../ioc/ContainerToken");
|
|
20
|
+
const errors_1 = require("@golemio/errors");
|
|
21
|
+
const tsyringe_1 = require("tsyringe");
|
|
22
|
+
let FeatureFlagServiceWrapper = class FeatureFlagServiceWrapper extends helpers_1.AbstractFeatureFlagServiceWrapper {
|
|
23
|
+
constructor(config, log) {
|
|
24
|
+
super();
|
|
25
|
+
const service = new feature_flags_1.FeatureFlagServiceFactory(config.featureFlags, log).getService(feature_flags_1.FeatureFlagsProvider.LaunchDarkly);
|
|
26
|
+
if (!service) {
|
|
27
|
+
throw new errors_1.CustomError(`FeatureFlagServiceFactory returned undefined for provider ${feature_flags_1.FeatureFlagsProvider.LaunchDarkly}`, false, this.constructor.name);
|
|
28
|
+
}
|
|
29
|
+
this._service = service;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
FeatureFlagServiceWrapper = __decorate([
|
|
33
|
+
(0, tsyringe_1.injectable)(),
|
|
34
|
+
__param(0, (0, tsyringe_1.inject)(ContainerToken_1.ContainerToken.Config)),
|
|
35
|
+
__param(1, (0, tsyringe_1.inject)(ContainerToken_1.ContainerToken.Logger)),
|
|
36
|
+
__metadata("design:paramtypes", [InputGatewayConfiguration_1.InputGatewayConfiguration, Object])
|
|
37
|
+
], FeatureFlagServiceWrapper);
|
|
38
|
+
exports.FeatureFlagServiceWrapper = FeatureFlagServiceWrapper;
|
|
39
|
+
//# sourceMappingURL=FeatureFlagServiceWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureFlagServiceWrapper.js","sourceRoot":"","sources":["../../../src/input-gateway/data-access/FeatureFlagServiceWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2EAA0H;AAC1H,6EAA+F;AAE/F,mFAAiF;AACjF,0DAAwD;AACxD,4CAA8C;AAC9C,uCAA0D;AAG1D,IAAa,yBAAyB,GAAtC,MAAa,yBAA0B,SAAQ,2CAAiC;IAG5E,YAA2C,MAAiC,EAAiC,GAAY;QACrH,KAAK,EAAE,CAAC;QAER,MAAM,OAAO,GAAG,IAAI,yCAAyB,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,oCAAoB,CAAC,YAAY,CAAC,CAAC;QACtH,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,IAAI,oBAAW,CACjB,6DAA6D,oCAAoB,CAAC,YAAY,EAAE,EAChG,KAAK,EACL,IAAI,CAAC,WAAW,CAAC,IAAI,CACxB,CAAC;SACL;QAED,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;CACJ,CAAA;AAjBY,yBAAyB;IADrC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;IAAqC,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAAzD,qDAAyB;GAHnE,yBAAyB,CAiBrC;AAjBY,8DAAyB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.featureFlagService = void 0;
|
|
4
|
+
const ioc_1 = require("../ioc");
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated For backwards compatibility. Use ioc container instead.
|
|
7
|
+
*/
|
|
8
|
+
const featureFlagService = ioc_1.InputGatewayContainer.resolve(ioc_1.ContainerToken.FeatureFlagService);
|
|
9
|
+
exports.featureFlagService = featureFlagService;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|