@stigg/js-client-sdk
Advanced tools
Comparing version
@@ -9,3 +9,6 @@ import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core'; | ||
getEntitlements(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetEntitlementsQuery>>; | ||
pollEntitlements(customerId: string, interval: number): import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("./generated/types").Exact<{ | ||
query: import("./generated/types").FetchEntitlementsQuery; | ||
}>>; | ||
} | ||
export default EntitlementsApi; |
@@ -9,2 +9,3 @@ import { EntitlementOptions, Customer, Entitlement, InvalidEntitlement, Plan, FallbackEntitlement } from './models'; | ||
getEntitlements: () => Promise<Entitlement[]>; | ||
refresh: () => Promise<void>; | ||
} | ||
@@ -20,2 +21,3 @@ export declare class Stigg implements StiggClient { | ||
setCustomerId(customerId: string): Promise<void>; | ||
refresh(): Promise<void>; | ||
getEntitlement<T extends Entitlement>(featureId: string, options?: EntitlementOptions): T | InvalidEntitlement | FallbackEntitlement; | ||
@@ -22,0 +24,0 @@ private handleNoEntitlementFound; |
@@ -5,5 +5,6 @@ export declare type ClientConfiguration = { | ||
customerId?: string; | ||
entitlementPollingInterval?: number; | ||
}; | ||
export declare function validateConfiguration(configuration: ClientConfiguration): void; | ||
export declare function withDefaults(configuration: ClientConfiguration): Partial<ClientConfiguration> & ClientConfiguration; | ||
export declare function withDefaults(configuration: ClientConfiguration): Required<ClientConfiguration>; | ||
export declare function ensureCustomerRefIdExists({ customerId }: ClientConfiguration): string; |
@@ -6,2 +6,3 @@ import { CacheService } from './cacheService'; | ||
import CachedEntitlement from './cachedEntitlement'; | ||
import { EntitlementFragment } from '../api/generated/types'; | ||
export declare class EntitlementsService { | ||
@@ -13,7 +14,12 @@ private readonly customerId; | ||
private loadingEntitlements; | ||
private entitlementsPollingObserver; | ||
constructor(customerId: string, cacheService: CacheService, client: ApolloClient<NormalizedCacheObject>); | ||
startPolling(interval: number): void; | ||
refresh(): Promise<void>; | ||
getEntitlement<T extends Entitlement>(featureRefId: string, requestedUsage?: number): T | InvalidEntitlement; | ||
loadEntitlements(): Promise<void>; | ||
private doLoadEntitlements; | ||
protected handleFetchedEntitlements(entitlements: Array<EntitlementFragment>): void; | ||
getEntitlements(): Promise<Entitlement[]>; | ||
stopPolling(): void; | ||
} | ||
@@ -20,0 +26,0 @@ export declare type GetEntitlementResult = { |
{ | ||
"name": "@stigg/js-client-sdk", | ||
"version": "0.20.0", | ||
"version": "0.22.0", | ||
"description": "Stigg client-side SDK for Browser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2148308
0.19%4115
0.37%22
-4.35%