@hmcts/rpx-xui-common-lib 2.0.21 → 2.0.23
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/esm2022/lib/models/feature-user.mjs +1 -1
- package/esm2022/lib/services/feature-toggle/launch-darkly.service.mjs +15 -15
- package/fesm2022/hmcts-rpx-xui-common-lib.mjs +14 -14
- package/fesm2022/hmcts-rpx-xui-common-lib.mjs.map +1 -1
- package/lib/models/feature-user.d.ts +3 -5
- package/lib/services/feature-toggle/launch-darkly.service.d.ts +9 -9
- package/package.json +2 -2
|
@@ -3,10 +3,8 @@ export declare class AnonymousFeatureUser {
|
|
|
3
3
|
}
|
|
4
4
|
export declare class LoggedInFeatureUser {
|
|
5
5
|
key: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
orgId: string;
|
|
10
|
-
};
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
roles: string[];
|
|
8
|
+
orgId: string;
|
|
11
9
|
}
|
|
12
10
|
export type FeatureUser = AnonymousFeatureUser | LoggedInFeatureUser;
|
|
@@ -6,21 +6,21 @@ export declare class LaunchDarklyService implements FeatureToggleService {
|
|
|
6
6
|
private client;
|
|
7
7
|
private readonly ready;
|
|
8
8
|
private readonly features;
|
|
9
|
-
private
|
|
9
|
+
private context;
|
|
10
10
|
private clientId;
|
|
11
11
|
initialize(user: FeatureUser, clientId: string): void;
|
|
12
12
|
isEnabled(feature: string, defaultValue?: boolean): Observable<boolean>;
|
|
13
13
|
getArray<R = any>(feature: string): Observable<R[]>;
|
|
14
14
|
getValue<R>(feature: string, defaultValue: R): Observable<R>;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
* This method returns an observable that will only get the state of the feature toggle
|
|
17
|
+
* once. It calls the LD SDK directly, and should only be used in circumstances where
|
|
18
|
+
* only one value should be emitted, that value coming directly from LD. This will likely
|
|
19
|
+
* only apply for Guards, and should be used only when absolutely necessary.
|
|
20
|
+
* @see getValue for regular usage.
|
|
21
|
+
* @param feature string
|
|
22
|
+
* @param defaultValue R
|
|
23
|
+
*/
|
|
24
24
|
getValueOnce<R>(feature: string, defaultValue: R): Observable<R>;
|
|
25
25
|
getValueSync<R>(feature: string, defaultValue: R): R;
|
|
26
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<LaunchDarklyService, never>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmcts/rpx-xui-common-lib",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"launchdarkly-js-client-sdk": "^
|
|
5
|
+
"launchdarkly-js-client-sdk": "^3.3.0",
|
|
6
6
|
"ngx-pagination": "^3.2.1",
|
|
7
7
|
"rpx-xui-translation": "^0.1.1"
|
|
8
8
|
},
|