@stigg/js-client-sdk 1.30.0 → 1.31.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/api/EdgeApiClient.d.ts +2 -2
- package/dist/api/EntitlementsApi.d.ts +2 -2
- package/dist/client.d.ts +16 -7
- package/dist/configuration.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +0 -3
- package/dist/services/entitlementCheckReportingService.d.ts +3 -2
- package/dist/services/entitlementsService.d.ts +8 -12
- package/dist/src/api/EdgeApiClient.d.ts +2 -2
- package/dist/src/api/EntitlementsApi.d.ts +2 -2
- package/dist/src/client.d.ts +16 -7
- package/dist/src/configuration.d.ts +1 -0
- package/dist/src/models.d.ts +0 -3
- package/dist/src/services/entitlementCheckReportingService.d.ts +3 -2
- package/dist/src/services/entitlementsService.d.ts +8 -12
- package/package.json +1 -1
- package/dist/src/utils/cacheKeysHelpers.d.ts +0 -5
- package/dist/utils/cacheKeysHelpers.d.ts +0 -5
|
@@ -14,9 +14,9 @@ export declare class EdgeApiClient {
|
|
|
14
14
|
customerToken?: string | null;
|
|
15
15
|
}): EdgeApiClient | null;
|
|
16
16
|
getPaywall(productId?: string, billingCountryCode?: string): Promise<ApolloQueryResult<GetPaywallQuery>>;
|
|
17
|
-
getEntitlements(customerId: string): Promise<ApolloQueryResult<GetEntitlementsQuery>>;
|
|
17
|
+
getEntitlements(customerId: string, resourceId: string | undefined): Promise<ApolloQueryResult<GetEntitlementsQuery>>;
|
|
18
18
|
getSdkConfiguration(): Promise<ApolloQueryResult<GetSdkConfigurationQuery>>;
|
|
19
|
-
watchEntitlements(customerId: string, interval: number): ObservablePoller<GetEntitlementsQuery>;
|
|
19
|
+
watchEntitlements(customerId: string, interval: number, resourceId: string | undefined): ObservablePoller<GetEntitlementsQuery>;
|
|
20
20
|
private get;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -5,8 +5,8 @@ declare class EntitlementsApi {
|
|
|
5
5
|
private readonly client;
|
|
6
6
|
private readonly edgeApiClient;
|
|
7
7
|
constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
|
|
8
|
-
getEntitlements(customerId: string, skipEdge?: boolean): Promise<import("@apollo/client/core").ApolloQueryResult<GetEntitlementsQuery>>;
|
|
9
|
-
pollEntitlements(customerId: string, interval: number): import("../utils/ObservablePoller").ObservablePoller<GetEntitlementsQuery> | import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("@stigg/api-client-js/src/generated/sdk").Exact<{
|
|
8
|
+
getEntitlements(customerId: string, skipEdge?: boolean, resourceId?: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetEntitlementsQuery>>;
|
|
9
|
+
pollEntitlements(customerId: string, interval: number, resourceId?: string): import("../utils/ObservablePoller").ObservablePoller<GetEntitlementsQuery> | import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("@stigg/api-client-js/src/generated/sdk").Exact<{
|
|
10
10
|
query: import("@stigg/api-client-js/src/generated/sdk").FetchEntitlementsQuery;
|
|
11
11
|
}>>;
|
|
12
12
|
reportEntitlementRequested(featureId: string, customerId: string, entitlementCheckResult: EntitlementCheckResult, resourceId?: string, requestedUsage?: number): Promise<void>;
|
package/dist/client.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export interface StiggClient {
|
|
|
7
7
|
getBooleanEntitlement: (params: GetBooleanEntitlement) => BooleanEntitlement;
|
|
8
8
|
getNumericEntitlement: (params: GetNumericEntitlement) => NumericEntitlement;
|
|
9
9
|
getMeteredEntitlement: (params: GetMeteredEntitlement) => MeteredEntitlement;
|
|
10
|
-
setCustomerId: (customerId: string, customerToken?: string | null) => Promise<void>;
|
|
10
|
+
setCustomerId: (customerId: string, customerToken?: string | null, resourceId?: string | null) => Promise<void>;
|
|
11
11
|
clearCustomer: () => void;
|
|
12
|
+
setResource: (resourceId: string) => Promise<void>;
|
|
13
|
+
clearResource: () => Promise<void>;
|
|
12
14
|
getPaywall: (params?: GetPaywall) => Promise<Paywall>;
|
|
13
15
|
getCustomer: () => Promise<Customer>;
|
|
14
16
|
getCoupons(): Promise<Coupon[]>;
|
|
@@ -69,11 +71,19 @@ export declare class Stigg implements StiggClient {
|
|
|
69
71
|
/**
|
|
70
72
|
* Set the customer ID, usually after the customer signs in or restores a session
|
|
71
73
|
*/
|
|
72
|
-
setCustomerId(customerId: string, customerToken?: string | null): Promise<void>;
|
|
74
|
+
setCustomerId(customerId: string, customerToken?: string | null, resourceId?: string | null): Promise<void>;
|
|
73
75
|
/**
|
|
74
76
|
* Clear the customer ID, usually after the customer signs out
|
|
75
77
|
*/
|
|
76
78
|
clearCustomer(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Set the customer's resource ID, usually after the customer select a specific resource.
|
|
81
|
+
*/
|
|
82
|
+
setResource(resourceId: string): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Unset the customer's resource ID, usually after the customer exit a specific resource.
|
|
85
|
+
*/
|
|
86
|
+
clearResource(): Promise<void>;
|
|
77
87
|
/**
|
|
78
88
|
* Reload entitlements
|
|
79
89
|
*/
|
|
@@ -86,7 +96,7 @@ export declare class Stigg implements StiggClient {
|
|
|
86
96
|
* @param {BooleanEntitlementOptions} options
|
|
87
97
|
* @return {BooleanEntitlement} boolean entitlement
|
|
88
98
|
*/
|
|
89
|
-
getBooleanEntitlement({ featureId, options
|
|
99
|
+
getBooleanEntitlement({ featureId, options }: GetBooleanEntitlement): BooleanEntitlement;
|
|
90
100
|
/**
|
|
91
101
|
* Get numeric entitlement of feature for a customer
|
|
92
102
|
*
|
|
@@ -95,7 +105,7 @@ export declare class Stigg implements StiggClient {
|
|
|
95
105
|
* @param {NumericEntitlementOptions} options
|
|
96
106
|
* @return {NumericEntitlement} numeric entitlement
|
|
97
107
|
*/
|
|
98
|
-
getNumericEntitlement({ featureId, options
|
|
108
|
+
getNumericEntitlement({ featureId, options }: GetNumericEntitlement): NumericEntitlement;
|
|
99
109
|
/**
|
|
100
110
|
* Get metered entitlement of feature for a customer
|
|
101
111
|
*
|
|
@@ -104,7 +114,7 @@ export declare class Stigg implements StiggClient {
|
|
|
104
114
|
* @param {MeteredEntitlementOptions} options
|
|
105
115
|
* @return {MeteredEntitlement} metered entitlement
|
|
106
116
|
*/
|
|
107
|
-
getMeteredEntitlement({ featureId, options
|
|
117
|
+
getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
|
|
108
118
|
/**
|
|
109
119
|
* Get paywall data for rendering the paywall
|
|
110
120
|
* @deprecated *Optional* `productId` is now deprecated and will be changed to a *required* field soon.
|
|
@@ -133,10 +143,9 @@ export declare class Stigg implements StiggClient {
|
|
|
133
143
|
/**
|
|
134
144
|
* Get a list of entitlements
|
|
135
145
|
*
|
|
136
|
-
* @param {string} resourceId
|
|
137
146
|
* @returns {Promise<Entitlement[]>}
|
|
138
147
|
*/
|
|
139
|
-
getEntitlements(
|
|
148
|
+
getEntitlements(): Promise<Entitlement[]>;
|
|
140
149
|
/**
|
|
141
150
|
* Estimate subscription
|
|
142
151
|
* @return {Promise<SubscriptionPreview>} Preview of the subscription.
|
package/dist/configuration.d.ts
CHANGED