@stigg/js-client-sdk 0.41.1 → 0.42.1
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.
|
@@ -5,6 +5,7 @@ import CachedEntitlement from './cachedEntitlement';
|
|
|
5
5
|
import { CacheService } from './cacheService';
|
|
6
6
|
import { Decision } from './entitlementDecisionService';
|
|
7
7
|
import { LoggerService } from './loggerService';
|
|
8
|
+
import { EventNames, Events } from './eventEmitter';
|
|
8
9
|
export declare class EntitlementsService {
|
|
9
10
|
private readonly customerId;
|
|
10
11
|
private readonly cacheService;
|
|
@@ -14,7 +15,10 @@ export declare class EntitlementsService {
|
|
|
14
15
|
private loadingEntitlements;
|
|
15
16
|
private entitlementsPollingObserver;
|
|
16
17
|
private entitlementCheckReportingService;
|
|
18
|
+
private readonly eventEmitter;
|
|
17
19
|
constructor(customerId: string, cacheService: CacheService, client: ApolloClient<NormalizedCacheObject>, batchedGraphClient: ApolloClient<NormalizedCacheObject>, loggerService: LoggerService);
|
|
20
|
+
addListener<K extends EventNames>(eventName: K, listener: Events[K]): void;
|
|
21
|
+
removeListener<K extends EventNames>(eventName: K, listener: Events[K]): void;
|
|
18
22
|
startPolling(interval: number): void;
|
|
19
23
|
stopPolling(): void;
|
|
20
24
|
restartPolling(intervalMs: number): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
import CachedEntitlement from './cachedEntitlement';
|
|
3
|
+
export interface Events {
|
|
4
|
+
entitlementsUpdated: (data: Map<string, CachedEntitlement>) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare type EventNames = keyof Events;
|
|
7
|
+
export declare class TypedEventEmitter extends TypedEmitter<Events> {
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigg/js-client-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"description": "Stigg client-side SDK for Browser",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"graphql": "^16.0.1",
|
|
33
33
|
"husky": "^7.0.4",
|
|
34
34
|
"lint-staged": "^12.0.2",
|
|
35
|
-
"lodash": "^4.17.21"
|
|
35
|
+
"lodash": "^4.17.21",
|
|
36
|
+
"tiny-typed-emitter": "^2.1.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@commitlint/cli": "^14.1.0",
|