@stigg/js-client-sdk 0.20.0 → 0.22.2

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/dist/models.d.ts CHANGED
@@ -109,6 +109,11 @@ export declare type Plan = {
109
109
  prices: Price[];
110
110
  defaultTrialConfig?: DefaultTrialConfig | null;
111
111
  compatibleAddons: Addon[];
112
+ product: Product;
113
+ };
114
+ export declare type Product = {
115
+ id: string;
116
+ displayName?: string | null;
112
117
  };
113
118
  export declare type DefaultTrialConfig = {
114
119
  duration: number;
@@ -3,17 +3,23 @@ import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
3
3
  import { Entitlement, InvalidEntitlement } from '../models';
4
4
  import { Decision } from './entitlementDecisionService';
5
5
  import CachedEntitlement from './cachedEntitlement';
6
+ import { EntitlementFragment } from '../api/generated/types';
6
7
  export declare class EntitlementsService {
7
8
  private readonly customerId;
8
9
  private readonly cacheService;
9
10
  private readonly entitlementsApi;
10
11
  private readonly modelMapper;
11
12
  private loadingEntitlements;
13
+ private entitlementsPollingObserver;
12
14
  constructor(customerId: string, cacheService: CacheService, client: ApolloClient<NormalizedCacheObject>);
15
+ startPolling(interval: number): void;
16
+ refresh(): Promise<void>;
13
17
  getEntitlement<T extends Entitlement>(featureRefId: string, requestedUsage?: number): T | InvalidEntitlement;
14
18
  loadEntitlements(): Promise<void>;
15
19
  private doLoadEntitlements;
20
+ protected handleFetchedEntitlements(entitlements: Array<EntitlementFragment>): void;
16
21
  getEntitlements(): Promise<Entitlement[]>;
22
+ stopPolling(): void;
17
23
  }
18
24
  export declare type GetEntitlementResult = {
19
25
  entitlement: CachedEntitlement | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigg/js-client-sdk",
3
- "version": "0.20.0",
3
+ "version": "0.22.2",
4
4
  "description": "Stigg client-side SDK for Browser",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/CHANGELOG.md DELETED
@@ -1,45 +0,0 @@
1
- # [0.20.0](https://github.com/stiggio/js-client-sdk/compare/0.19.0...0.20.0) (2022-03-20)
2
-
3
-
4
- ### Features
5
-
6
- * html paywall example ([9d0c59e](https://github.com/stiggio/js-client-sdk/commit/9d0c59e75926bd5cf9bf13396f243746027edb85))
7
-
8
-
9
-
10
- # [0.19.0](https://github.com/stiggio/js-client-sdk/compare/0.18.2...0.19.0) (2022-03-15)
11
-
12
-
13
- ### Features
14
-
15
- * fetch latest plans for paywall ([0a42890](https://github.com/stiggio/js-client-sdk/commit/0a428905b32d46a7ac051863e1a30e10410f5ead))
16
-
17
-
18
-
19
- ## [0.18.2](https://github.com/stiggio/js-client-sdk/compare/0.18.1...0.18.2) (2022-03-15)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * map plans default trial ([097d8d9](https://github.com/stiggio/js-client-sdk/commit/097d8d95dc0e8423f25b0e7887d0ab07dfcf5be7))
25
-
26
-
27
-
28
- ## [0.18.1](https://github.com/stiggio/js-client-sdk/compare/0.18.0...0.18.1) (2022-03-14)
29
-
30
-
31
- ### Bug Fixes
32
-
33
- * pipe trial subscriptions ([d5fd5a4](https://github.com/stiggio/js-client-sdk/commit/d5fd5a47b169e20660acd9bcf274fe0eeaae181f))
34
-
35
-
36
-
37
- # [0.18.0](https://github.com/stiggio/js-client-sdk/compare/0.17.1...0.18.0) (2022-03-14)
38
-
39
-
40
- ### Features
41
-
42
- * pipe trial subscriptions ([9fb9e6b](https://github.com/stiggio/js-client-sdk/commit/9fb9e6bca2095fce31b4325ff86fa9f8ac4d3f4d))
43
-
44
-
45
-