@stigg/js-client-sdk 0.20.0 → 0.22.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.
@@ -6,5 +6,8 @@ declare class EntitlementsApi {
6
6
  constructor(client: ApolloClient<NormalizedCacheObject>);
7
7
  getEntitlement(query: FetchEntitlement): Promise<import("@apollo/client/core").ApolloQueryResult<EntitlementQuery>>;
8
8
  getEntitlements(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetEntitlementsQuery>>;
9
+ pollEntitlements(customerId: string, interval: number): import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("./generated/types").Exact<{
10
+ query: import("./generated/types").FetchEntitlementsQuery;
11
+ }>>;
9
12
  }
10
13
  export default EntitlementsApi;
@@ -699,10 +699,6 @@ export declare enum EventLogType {
699
699
  SubscriptionCanceled = "SUBSCRIPTION_CANCELED",
700
700
  SubscriptionCreated = "SUBSCRIPTION_CREATED",
701
701
  SubscriptionExpired = "SUBSCRIPTION_EXPIRED",
702
- SubscriptionTrialConverted = "SUBSCRIPTION_TRIAL_CONVERTED",
703
- SubscriptionTrialEndsSoon = "SUBSCRIPTION_TRIAL_ENDS_SOON",
704
- SubscriptionTrialExpired = "SUBSCRIPTION_TRIAL_EXPIRED",
705
- SubscriptionTrialStarted = "SUBSCRIPTION_TRIAL_STARTED",
706
702
  SubscriptionUpdated = "SUBSCRIPTION_UPDATED"
707
703
  }
708
704
  export declare type FeatureFilter = {
package/dist/client.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface StiggClient {
6
6
  getPlans: () => Promise<Plan[]>;
7
7
  getCustomer: () => Promise<Customer>;
8
8
  getEntitlements: () => Promise<Entitlement[]>;
9
+ refresh: () => Promise<void>;
9
10
  }
10
11
  export declare class Stigg implements StiggClient {
11
12
  private readonly apiGateway;
@@ -16,6 +17,7 @@ export declare class Stigg implements StiggClient {
16
17
  private constructor();
17
18
  static initialize(configuration: ClientConfiguration): Promise<StiggClient>;
18
19
  setCustomerId(customerId: string): Promise<void>;
20
+ refresh(): Promise<void>;
19
21
  getEntitlement<T extends Entitlement>(featureId: string, options?: EntitlementOptions): T | InvalidEntitlement | FallbackEntitlement;
20
22
  private handleNoEntitlementFound;
21
23
  getPlans(): Promise<Plan[]>;
@@ -2,7 +2,8 @@ export declare type ClientConfiguration = {
2
2
  sdkKey: string;
3
3
  baseUri?: string;
4
4
  customerId?: string;
5
+ entitlementPollingInterval?: number;
5
6
  };
6
7
  export declare function validateConfiguration(configuration: ClientConfiguration): void;
7
- export declare function withDefaults(configuration: ClientConfiguration): Partial<ClientConfiguration> & ClientConfiguration;
8
+ export declare function withDefaults(configuration: ClientConfiguration): Required<ClientConfiguration>;
8
9
  export declare function ensureCustomerRefIdExists({ customerId }: ClientConfiguration): string;