@stigg/js-client-sdk 1.32.1 → 1.34.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.
- package/dist/client.d.ts +9 -6
- package/dist/index.js +313 -339
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +7 -4
- package/dist/src/client.d.ts +9 -6
- package/dist/src/models.d.ts +7 -4
- package/dist/src/utils/ModelMapper.d.ts +1 -1
- package/dist/utils/ModelMapper.d.ts +1 -1
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ClientConfiguration } from './configuration';
|
|
|
3
3
|
import { EventNames, Events } from './services/eventEmitter';
|
|
4
4
|
export interface StiggClient {
|
|
5
5
|
isCustomerLoaded: boolean;
|
|
6
|
+
isResourceLoaded: boolean;
|
|
6
7
|
isWidgetWatermarkEnabled: boolean;
|
|
7
8
|
getBooleanEntitlement: (params: GetBooleanEntitlement) => BooleanEntitlement;
|
|
8
9
|
getNumericEntitlement: (params: GetNumericEntitlement) => NumericEntitlement;
|
|
@@ -10,7 +11,7 @@ export interface StiggClient {
|
|
|
10
11
|
setCustomerId: (customerId: string, customerToken?: string | null, resourceId?: string | null) => Promise<void>;
|
|
11
12
|
clearCustomer: () => void;
|
|
12
13
|
setResource: (resourceId: string) => Promise<void>;
|
|
13
|
-
clearResource: () =>
|
|
14
|
+
clearResource: () => void;
|
|
14
15
|
getPaywall: (params?: GetPaywall) => Promise<Paywall>;
|
|
15
16
|
getCustomer: () => Promise<Customer>;
|
|
16
17
|
getActiveSubscriptions: (params?: GetActiveSubscriptions) => Promise<Subscription[]>;
|
|
@@ -32,7 +33,8 @@ export declare class Stigg implements StiggClient {
|
|
|
32
33
|
private readonly batchedGraphClient;
|
|
33
34
|
private readonly configuration;
|
|
34
35
|
private readonly loggerService;
|
|
35
|
-
private
|
|
36
|
+
private globalEntitlementsService;
|
|
37
|
+
private resourceEntitlementsService;
|
|
36
38
|
private readonly modelMapper;
|
|
37
39
|
private readonly eventEmitter;
|
|
38
40
|
private readonly initializationStateTracker;
|
|
@@ -56,6 +58,7 @@ export declare class Stigg implements StiggClient {
|
|
|
56
58
|
waitForInitialization(): Promise<StiggClient>;
|
|
57
59
|
private static initializeSdk;
|
|
58
60
|
get isCustomerLoaded(): boolean;
|
|
61
|
+
get isResourceLoaded(): boolean;
|
|
59
62
|
get isWidgetWatermarkEnabled(): boolean;
|
|
60
63
|
/**
|
|
61
64
|
* Add a listener to handle updates of entitlements changes
|
|
@@ -84,7 +87,7 @@ export declare class Stigg implements StiggClient {
|
|
|
84
87
|
/**
|
|
85
88
|
* Unset the customer's resource ID, usually after the customer exit a specific resource.
|
|
86
89
|
*/
|
|
87
|
-
clearResource():
|
|
90
|
+
clearResource(): void;
|
|
88
91
|
/**
|
|
89
92
|
* Reload entitlements
|
|
90
93
|
*/
|
|
@@ -97,7 +100,7 @@ export declare class Stigg implements StiggClient {
|
|
|
97
100
|
* @param {BooleanEntitlementOptions} options
|
|
98
101
|
* @return {BooleanEntitlement} boolean entitlement
|
|
99
102
|
*/
|
|
100
|
-
getBooleanEntitlement({ featureId, options }: GetBooleanEntitlement): BooleanEntitlement;
|
|
103
|
+
getBooleanEntitlement({ featureId, options, resourceId }: GetBooleanEntitlement): BooleanEntitlement;
|
|
101
104
|
/**
|
|
102
105
|
* Get numeric entitlement of feature for a customer
|
|
103
106
|
*
|
|
@@ -106,7 +109,7 @@ export declare class Stigg implements StiggClient {
|
|
|
106
109
|
* @param {NumericEntitlementOptions} options
|
|
107
110
|
* @return {NumericEntitlement} numeric entitlement
|
|
108
111
|
*/
|
|
109
|
-
getNumericEntitlement({ featureId, options }: GetNumericEntitlement): NumericEntitlement;
|
|
112
|
+
getNumericEntitlement({ featureId, options, resourceId }: GetNumericEntitlement): NumericEntitlement;
|
|
110
113
|
/**
|
|
111
114
|
* Get metered entitlement of feature for a customer
|
|
112
115
|
*
|
|
@@ -115,7 +118,7 @@ export declare class Stigg implements StiggClient {
|
|
|
115
118
|
* @param {MeteredEntitlementOptions} options
|
|
116
119
|
* @return {MeteredEntitlement} metered entitlement
|
|
117
120
|
*/
|
|
118
|
-
getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
|
|
121
|
+
getMeteredEntitlement({ featureId, options, resourceId }: GetMeteredEntitlement): MeteredEntitlement;
|
|
119
122
|
/**
|
|
120
123
|
* Get paywall data for rendering the paywall
|
|
121
124
|
* @deprecated *Optional* `productId` is now deprecated and will be changed to a *required* field soon.
|