@stigg/js-client-sdk 1.25.0 → 1.26.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.
@@ -9,6 +9,6 @@ declare class EntitlementsApi {
9
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<{
10
10
  query: import("@stigg/api-client-js/src/generated/sdk").FetchEntitlementsQuery;
11
11
  }>>;
12
- reportEntitlementRequested(featureId: string, customerId: string, entitlementCheckResult: EntitlementCheckResult, requestedUsage?: number): Promise<void>;
12
+ reportEntitlementRequested(featureId: string, customerId: string, entitlementCheckResult: EntitlementCheckResult, resourceId?: string, requestedUsage?: number): Promise<void>;
13
13
  }
14
14
  export default EntitlementsApi;
package/dist/client.d.ts CHANGED
@@ -12,7 +12,7 @@ export interface StiggClient {
12
12
  getPaywall: (params?: GetPaywall) => Promise<Paywall>;
13
13
  getCustomer: () => Promise<Customer>;
14
14
  getCoupons(): Promise<Coupon[]>;
15
- getEntitlements: () => Promise<Entitlement[]>;
15
+ getEntitlements: (resourceId?: string) => Promise<Entitlement[]>;
16
16
  refresh: () => Promise<void>;
17
17
  waitForCheckoutCompleted(params?: WaitForCheckoutCompleted): Promise<Subscription | null>;
18
18
  waitForInitialization(): Promise<StiggClient>;
@@ -80,24 +80,31 @@ export declare class Stigg implements StiggClient {
80
80
  refresh(): Promise<void>;
81
81
  /**
82
82
  * Get boolean entitlement of feature for a customer
83
+ *
84
+ * @param {string} featureId
85
+ * @param {string} resourceId
86
+ * @param {BooleanEntitlementOptions} options
87
+ * @return {BooleanEntitlement} boolean entitlement
83
88
  */
84
- getBooleanEntitlement({ featureId, options }: GetBooleanEntitlement): BooleanEntitlement;
89
+ getBooleanEntitlement({ featureId, options, resourceId }: GetBooleanEntitlement): BooleanEntitlement;
85
90
  /**
86
91
  * Get numeric entitlement of feature for a customer
87
92
  *
88
93
  * @param {string} featureId
94
+ * @param {string} resourceId
89
95
  * @param {NumericEntitlementOptions} options
90
96
  * @return {NumericEntitlement} numeric entitlement
91
97
  */
92
- getNumericEntitlement({ featureId, options }: GetNumericEntitlement): NumericEntitlement;
98
+ getNumericEntitlement({ featureId, options, resourceId }: GetNumericEntitlement): NumericEntitlement;
93
99
  /**
94
100
  * Get metered entitlement of feature for a customer
95
101
  *
96
102
  * @param {string} featureId
103
+ * @param {string} resourceId
97
104
  * @param {MeteredEntitlementOptions} options
98
105
  * @return {MeteredEntitlement} metered entitlement
99
106
  */
100
- getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
107
+ getMeteredEntitlement({ featureId, options, resourceId }: GetMeteredEntitlement): MeteredEntitlement;
101
108
  /**
102
109
  * Get paywall data for rendering the paywall
103
110
  * @deprecated *Optional* `productId` is now deprecated and will be changed to a *required* field soon.
@@ -126,9 +133,10 @@ export declare class Stigg implements StiggClient {
126
133
  /**
127
134
  * Get a list of entitlements
128
135
  *
136
+ * @param {string} resourceId
129
137
  * @returns {Promise<Entitlement[]>}
130
138
  */
131
- getEntitlements(): Promise<Entitlement[]>;
139
+ getEntitlements(resourceId?: string): Promise<Entitlement[]>;
132
140
  /**
133
141
  * Estimate subscription
134
142
  * @return {Promise<SubscriptionPreview>} Preview of the subscription.